Let’s learn java continue statement. Java continue statement If 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. It can be used with the…

Read More Java continue statement

Let’s learn convert char array to string in java. Convert char array to string in java To convert a char array to a string there are two ways. Convert char array to string using Constructor: Here first create String object and pass char array name ‘charArray’ to the string constructor. Here’s the java program. public…

Read More Convert char array to string in java

Let’s learn calculate percentage in java. Calculate percentage in java 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 “%”. Formula to calculate percentage is, percentage = ( a / b )…

Read More Calculate percentage in java

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 java convert binary to decimal. 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 next step each binary…

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 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