Java Comparator and Comparable demystified

Java comparator and java comparable both achieve the same thing, helps to sort objects and both are Interfaces. Let us first explore comparable ( java.lang.comparable) and then comparator ( java.util.Comparator ). Comparable Quick facts: Belongs to java.lang  package and has a single method int compareTo(T o).  The… Read More

How to create a directory in java

Java File class provides methods to create directory. Two important methods are mkdir and mkdirs. It is important to understand these two methods and pay attention to the return values to confirm that the operation is successful. Method mkdir() Creates the directory named by this… Read More