Java

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 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 new file, first create File object then…

Read More Java create new file

Let’s learn how to create directory in java? How to create directory in java How to create directory is most frequently asked interview question. 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…

Read More How to create directory in java

Let’s learn what is a continue statement in java? Continue statement in java When continue statement is encountered inside a loop then control jumps to the beginning of the loop for next iteration instead of executing remaining or following statements of current iteration. Continue statement in java is used in many loop control structures. Continue…

Read More Continue statement in java

Let’s learn what is bubble sort in java? Bubble sort in java Bubble sort is considered as simplest sorting algorithm for the fact that given array is traversed from first to last element. And while traversing, current element is compared with adjacent element and if current element is greater than the adjacent element, it is…

Read More Bubble sort in java

Let’s learn what is a binary search in java? Binary search in java Binary search is the process of searching key element from sorted array. Binary search algorithm java As you can see in the below image we have a sorted array of size 5. Now given an array, we have to find whether key…

Read More Binary search in java

Let’s learn system arraycopy() method in java. System arraycopy() method in java System Arraycopy method copies an array from the specified source array, beginning at the specified position, to the specified position of the destination array. Using arraycopy() method subsequence array components are copied from source array referenced by source to the destination array referenced…

Read More System arraycopy() method in java