Category Archives: Java Array

How to Copy One Array to Another in Java

Here you will learn how to copy one array to another in Java. There are mainly four different ways to copy all elements of one array into another array in Java. 1. Manually 2. Arrays.copyOf() 3. System.arraycopy() 4. Object.clone() Lets discuss each of them in brief. How to Copy One Array to Another in Java… Read More »

Convert Array to ArrayList in Java

In this tutorial you will learn how to convert array to arraylist in Java. There are mainly two ways to convert a Java array to arraylist. Using Arrays.asList() method Using Collections.addAll() method Below I have shared an example of each of these methods. In these examples we are converting string array to arraylist. Also Read: Convert… Read More »

Radix Sort Java Program and Algorithm

This tutorial is about radix sort java program and algorithm. Here is a very basic and detailed description of algorithm that we follow to implement the radix sort in java. We mostly rely on the place value of digits to sort it out in the given list. So, our first basic task is to find… Read More »

Program for Binary Search in Java

Binary search in Java is a divide and conquer technique used to search an element in an array. The array is assumed to be sorted in ascending order. Below I have shared the program for binary search in Java. You can ask your doubts if you find difficulty to understand the program. Java Program for… Read More »

2D Array in Java

In this tutorial you will learn about 2D array in Java. If you don’t know about what is array then I would recommend you to read the previous tutorial: Array in Java (1D) 2D Array in Java Array is a collection of similar type of elements. Array can be of any dimension but generally we… Read More »

Anonymous Array in Java

An array without name is known as anonymous array in java.  As the array do not have any name so it can be used only once.  Anonymous array is passed as an argument of method.  Anonymous array is created and initialized in the same line. How to Create Anonymous Array in Java? A sample program… Read More »

Array in Java (1D)

In this tutorial I will talk about one dimensional array in java. In the next tutorial we will learn about multidimensional array. Array in Java Array is the collection of similar type of data having contiguous memory location.  Due to contiguous memory location the performance becomes fast.  The biggest disadvantage of array is, we can’t… Read More »

Java Program to Find Transpose of Matrix

Transpose of a matrix is a new matrix whose columns are the rows of original matrix and rows are the columns of original matrix. Take below example for transpose of matrix of order 3×3. Image Source Below I have shared java program that will find transpose of matrix of any order. If you find any… Read More »