Skip to content

Tag Archives: Java-Array-Programs

In Java sorting and searching an element in an array is very easy. Unlike C, where we have to make all the functions to work,… Read More
Sorting an array can be done by using inbuilt sort function while for the insertion we have to create a new array to do so… Read More
In java, the arrays are immutable i.e if the array is once assigned or instantiated the memory allocated for the array can’t be decreased or… Read More
Given two arrays, the task is to merge or concatenate them and store the result into another array. Examples: Input: arr1[] = { 1, 3,… Read More
Given two given arrays of equal length, the task is to find if given arrays are equal or not. Two arrays are said to be… Read More
Given task is to implement a class in Java which behaves just like the Dynamic array using ArrayList. ArrayList is same as dynamic arrays with… Read More
Given an array a of integers of size N integers, the task is to find the ratio of positive numbers, negative numbers and zeros in… Read More
Given an unsorted array A of size N, the task is to find the minimum and maximum values that can be calculated by adding exactly… Read More
There is no size() method available with the array. But there is a length field available in the array that can be used to find… Read More
Below are the various methods to convert an Array to String in Java: Arrays.toString() method: Arrays.toString() method is used to return a string representation of… Read More
Given an array of size n, the task is to add an element x in this array in Java. The size of the array cannot… Read More
An array is a collection of items stored at contiguous memory locations. In this article, we will see how to insert an element in an… Read More
Given an array arr in Java, the task is to print the contents of this array without using any loop. First let’s see the loop method. … Read More
Given an array, the task is to write a Java program to check whether a specific element is present in this Array or not. Examples: … Read More
Array class in java.lang.reflect package is a part of the Java Reflection. This class provides static methods to create and access Java arrays dynamically. It… Read More

Start Your Coding Journey Now!