Skip to content

Tag Archives: Java-Array-Programs

Given an array and a key, the task is to remove all occurrences of the specified key from the array in Java. Examples: Input: array… Read More
A Dynamic array (vector in C++, ArrayList in Java) automatically grows when we try to make an insertion and there is no more space left… Read More
Given an array of N integers and a number M. The task is to find out the maximum number of unique integers among all possible… Read More
Given an array, the task is to reverse the given array in Java. Examples:  Input : 1, 2, 3, 4, 5 Output :5, 4, 3,… Read More
Array has length property which provides the length of the Array or Array object. It is the total space allocated in memory during the initialization… Read More
As we all know an array is a group of liked-typed variables that are referred to by a common name while on the other hand… Read More
Given a Linked List in Java, the task is to convert this LinkedList to Array. Examples: Input: LinkedList: ['G', 'e', 'e', 'k', 's'] Output: Array:… Read More
In Java, as we all know ArrayList class is derived from the List interface. Here we are given an ArrayList of strings and the task… Read More
Given a Primitive Array, the task is to get a Slice of this array in Java, using start and ending index. Examples: Input: arr[] =… Read More
Given a Set of Strings, the task is to convert the Set into an Array of Strings in Java. Examples: Input: Set<String>: ["ForGeeks", "A Computer… Read More
Given a Stream of Arrays in Java, the task is to Flatten the Stream using forEach() method. Examples: Input: arr[][] = {{ 1, 2 },… Read More
As we know whenever it comes to writing over a file, write() method of the File class comes into play but here we can not… Read More
References: Writer Class Approach: Writer class is used to write character stream, by which byte array can be passed as an argument. By this way,… Read More
Given a Character Array, the task is to convert this array into an IntStream containing the ASCII values of the character elements. Examples: Input: char[]… Read More
Given an array of a fixed length. The task is to remove an element at a specific index from the array. Examples:  Input: arr[] =… Read More

Start Your Coding Journey Now!