In this guide, we will see how to split a string into array of characters in Java. This can be archived by using this regex… [Read More]
Convert Integer List to int Array in Java
In this guide, we will see how to convert Integer List to int Array in Java. There are several ways, you can do this conversion,… [Read More]
String Array in Java
In this guide, you will learn about string array in java, how to use them and various operations that you can perform on string array… [Read More]
Difference between Array and ArrayList
In this guide, we will discuss the difference between Array and ArrayList. What is an Array? An array is a collection of elements of similar… [Read More]
Difference between length of Array and size of ArrayList in Java
In this tutorial, you will learn the difference between length of Array and size of ArrayList in Java.. Length of Array: // creating an array… [Read More]
Converting a HashSet to an Array
Here is the program for converting a HashSet to an array. Program import java.util.HashSet; class ConvertHashSettoArray{ public static void main(String[] args) { // Create a… [Read More]
Sorting float array in Java example
In this tutorial we are gonna learn how to sort a float array. import java.util.Arrays; class SortingFloatArrayExample { public static void main(String[] args) { //… [Read More]
Sorting double array in Java example
import java.util.Arrays; class SortingDoubleArray { public static void main(String[] args) { // Creating a Double Array double[] doubleArray = new double[] { 13.1, 2.5, 2.2,… [Read More]
Sorting char array in Java example
In this example we are sorting a char array. We have demonstrated two types of sorting in the program 1) Complete sorting using sort(char[] a)… [Read More]
Sort byte array in Java
This is the example of sorting a byte array in Java. Here we have done two types of sorting 1) complete sorting using sort(byte[] a)… [Read More]
Java – Finding minimum and maximum values in an array
In this example we are finding out the maximum and minimum values from an int array. class MinMaxExample { public static void main(String args[]){ int array[]… [Read More]
Random shuffling of an array in Java
import java.util.Arrays; import java.util.Collections; import java.util.List; class ShuffleArrayExample { public static void main(String[] args) { // String Array String[] stringArray = new String[] { “FF”,… [Read More]
Sort an Array in Descending (Reverse) Order – Java
The previous tutorial was all about sorting an array in ascending order. In this post we are going to learn how to sort an array… [Read More]
How to sort an Array in Java
This is the example of sorting an Array in java. Here we have two arrays, one is an integer array and another one is a… [Read More]
How to convert LinkedList to array using toArray() in Java
Converting LinkedList to array is very easy. You can convert a LinkedList of any type (such as double, String, int etc) to an array of… [Read More]