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 java convert decimal to octal. Java convert decimal to octal decimal to octal in java is one of the frequently asked interview question. In the below example we need to convert given decimal number (base value 10) into octal number (base value 8). To represent numeric value decimal number system uses 0-9 digits…

Read More Java convert decimal to octal

Let’s learn java convert decimal to hex. Java convert decimal to hex decimal to hexadecimal in java is one of the common java interview question. 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…

Read More Java convert decimal to hex

Let’s learn java convert date to string. Java convert date to string To convert date to string, format() method is used of class DateFormat. 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 java create new file. Java create new file 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 file, first create File object then call createNewFile() method to create new…

Read More Java create new file