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 how do you calculate a percentage in java? Calculate percentage in java Calculate percentage of a student is one of the most common interview question. To calculate percentage of a student we have to divide obtained marks of student by total marks. Basically percentage is a number expressed as fraction of 100 and…

Read More Calculate percentage 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 how do you convert binary to decimal in java? Java convert binary to decimal To convert from binary to decimal first user enters binary number using nextLine() method of Scanner class. This binary number is stored in String variable ‘strBinary’. Now this string variable is converted using Integer.parseInt() method (inbuilt function). In the…

Read More Java convert binary to decimal

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