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

Let’s learn 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 keyword in java…

Read More continue statement in java

Let’s learn convert char array to string in java. Convert char array to string in java character array to string in java is the most asked java interview question. To convert a char array to a string there are two ways. Using Constructor: creating string object and passing char array name ‘charArray’ to the string…

Read More Convert char array to string in java

Let’s learn calculate 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 denoted using percent sign…

Read More Calculate percentage in java

Let’s learn bubble sort in java. Bubble sort in java what is 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…

Read More Bubble sort in java

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

Read More Java convert binary to decimal

Let’s learn 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 element exist in…

Read More Binary search in java

Let’s learn system arraycopy() method in java. System arraycopy() method in java 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 by…

Read More System arraycopy() method in java

Let’s learn java program to add two numbers. Java program to add two numbers addition program in java is most common java interview question. In the below java code to add two numbers we are taking input from user using nextInt() method of Scanner class. First user enters two numbers. Then these two numbers are…

Read More Java program to add two numbers