Java

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

Let’s learn java continue statement. Java continue statement If continue statement is encountered within a loop then the current iteration is skipped and continued for next iteration. We can use continue statement only inside loops namely for loop, while loop and do while loop. Syntax continue; Java continue inside for loop public class ContinueJavaExample {…

Read More Java continue statement

Let’s learn bubble sort in java. Bubble sort in java Bubble sort is a comparison based sorting algorithm, that is, each pair is compared with adjacent elements and swapped till right order. And while traversing, current element is compared with adjacent element and if current element is greater than the adjacent element, it is swapped.…

Read More Bubble sort in java

Let’s learn binary search in java. Binary search in java Binary search is the process of searching key element from sorted array by frequently dividing in search space in half. 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…

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