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 how do you convert decimal to octal in java? 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…

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 how do I convert a date to a string in java? 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…

Read More Java convert date to string

Let’s learn how do you create a new file in java? 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…

Read More Java create new file

Let’s learn how to create directory in java? How to create directory in java How to create folder in java is most frequently asked java interview question. There are two methods to create directory. They are mkdir() and mkdirs() of class File which returns boolean value. mkdir() method create single directory. File directory = new…

Read More How to create directory in java