Let’s learn how to delete a directory in java. How to delete a directory in java To delete a directory use delete() method of File class. delete() method deletes file or directory denoted by this abstract pathname. If this pathname denotes a directory, then the directory must be empty in order to be deleted. delete()…

Read More How to delete a directory in java

Let’s learn convert decimal to octal in java. Convert decimal to octal in java In the below example we are going to convert decimal number (base value 10) to an octal number (base value 8). To represent numeric value, decimal number system uses 0-9 digit and octal number system uses 0-7 digit. There are two…

Read More Convert decimal to octal in java

Let’s learn convert decimal to hex in java. Convert decimal to hex in java In number system, decimal number has a base of ten and has digits from 0 to 9. Whereas hexadecimal number has a base 16 and has digits from 0 to 9 and A to F. Now let’s see the comparison through…

Read More Convert decimal to hex in java

Let’s learn java convert date to string. Java convert date to string To convert date to string, format() method of DateFormat class is used. Here DateFormat class is an abstract class and it’s child class is SimpleDateFormat class. The syntax and example for format() method of DateFormat class is as below. Syntax: String format(Date date) Parameters: date…

Read More Java convert date to string

Let’s learn create new file in java. Create new file in java In this post we are going to learn to create a new file using createNewFile() method of File class which creates a new, empty file and returns a boolean value. In creating a new file, first create File object then call createNewFile() method…

Read More Create new file in java

Let’s learn how to create directory in java. How to create directory in java There are two methods to create directory. They are mkdir() and mkdirs() of class File which returns boolean value. File mkdir() method creates the directory named by this abstract pathname. File mkdir() method returns true if and only if the directory…

Read More How to create directory in java