Java

Core Java Tutorial

Core Java Tutorial

Java Basics Java Primitive Data Types Operators in Java Control Flow : If:then and If:then:else statements Control Flow: For, while and do while loop in Java Arrays in Java Classes and Met...

Jun 02, 2017 · Tushar
Java Program to check if two arrays are Equal

Java Program to check if two arrays are Equal

1. Using Custom Method First we will write the manual method to compare two Java Arrays for Equality. The logic is pretty simple, first we compare the length of both Arrays in consideration and if...

Jun 01, 2017 · Tushar
Java program to find duplicate elements in an String array.

Java program to find duplicate elements in an String array.

We have created a sample String array with few String values to check for Duplicate. To Check the Duplicate we need to compare the current String value with rest of the values. The below code approach...

Jun 01, 2017 · Tushar
Java Code to fill int / double Array with random values.

Java Code to fill int / double Array with random values.

To get the Random int values we utilise the java.util.Math provided under java library. Since Math.random()returns random double value between 0 and 1 , we multiply it by 100 to get random numbers bet...

Jun 01, 2017 · Tushar
Java Code to Copy Array into Another Array

Java Code to Copy Array into Another Array

1. Using Custom Method   import java.util.Arrays; public class ArrayCopy { public static void main(String args[]) { String[] myStringArray = { "Alice", "Bob", "Tim", "John",...

May 29, 2017 · Tushar
Program : Remove an Element from int Array in Java

Program : Remove an Element from int Array in Java

Although there are inbuilt method in the commons.lang library using which we can remove the element in array with just a single statement , we will first approach this using a custom method to see how...

May 29, 2017 · Tushar
Program: Java Code to Reverse an int Array

Program: Java Code to Reverse an int Array

1. Using Custom Method Following is the Java code to reverse the elements of an array by writing a self custom method. import java.util.Arrays; public class ArrayReverse { public static vo...

May 29, 2017 · Tushar
Program : Calculate Average of Array Elements in Java

Program : Calculate Average of Array Elements in Java

Following is the code to calculate the Average of elements in the Array. import java.util.Scanner; public class ArrayChallange { public static Scanner scanner= new Scanner(System.in);...

May 28, 2017 · Tushar