How to check if directory is empty in Java
How to check if a directory is empty in Java. Example using list() method of File class.
How to copy files in Java
How to copy files in Java with three examples: Classic method with streams, using FileChannel class and using Files class.
How to get the current working directory in Java
How to get the current working directory in Java using user.dir system parameter.
How to calculate date/time difference in Java
How to calculate the date and time difference in Java using a simple method of division and remainder of division.
How to compare dates in Java
How to compare dates in Java using Date (compareTo, before, after, equals), Calendar(before, after, equals) and LocalDate(isBefore, isAfter, equals) classes.
How to get input from Java Console
How to get input from Java Console. Examples using System.console
, Scanner
and BufferedReader
+ InputStreamReader
.
Search
Other Posts
Follow Us On