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]
How to convert Vector to array in java
In this article, we will learn how to convert a Vector to array in Java. Vector class uses dynamic arrays internally, however in certain cases,… [Read More]
Java program to sum the elements of an array
In this tutorial we will see how to sum up all the elements of an array. Program 1: No user interaction /** * @author: BeginnersBook.com… [Read More]
How to Convert an array to ArrayList in java
In the last tutorial, you learned how to convert an ArrayList to Array in Java. In this guide, you will learn how to convert an… [Read More]
Convert ArrayList to Array in Java
In this tutorial, you will learn how to convert ArrayList to Array in Java. We will see two ways to do the conversion: In the… [Read More]
Java Array explained with examples
Array is a collection of elements of same type. For example an int array contains integer elements and a String array contains String elements. The… [Read More]