The Array class in java.lang.reflect package is a part of the Java Reflection. This class provides static methods to dynamically create and access Java arrays. It is a final class, which means it can’t be instantiated, or changed. Only the methods of this class can be used by the class name itself.
The Arrays class in java.util package is a part of the Java Collection Framework. This class provides static methods to dynamically create and access Java arrays. It consists of only static methods and the methods of Object class. The methods of this class can be used by the class name itself.
Difference between Array and Arrays in Java:
- The package of existence:
The Array class exists in the java.lang.reflect package whereas the Arrays class exists in the java.util package.
Class Hierarchy of Array:
java.lang.Object ↳ java.lang.reflect ↳ Class Array
Class Hierarchy of Arrays:
java.lang.Object ↳ java.util ↳ Class Arrays
The Array class is immutable in nature whereas the Arrays class is not. By immutable, it means that the class cannot be extended or inherited. The Array class is declared as final to achieve immutability.
Class Declaration of Array:
public final class Array extends Object
Class Declaration of Arrays:
public class Arrays extends Object
The java.util.Arrays class contains various methods for manipulating arrays (such as sorting and searching) whereas this java.lang.reflect.Array class provides static methods to dynamically create and access Java arrays. This Array class keeps the array to be type-safe.
// Java program to show Array vs Arrays
// Get the size of the array
 intArray =
// Add elements into the array
// using reflect.Array class
// Printing the Array content
// using util.Arrays class
[10, 0, 0, 0, 0]
Attention reader! Don’t stop learning now. Get hold of all the important Java and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.
- Java.util.BitSet class methods in Java with Examples | Set 2
- Java.util.BitSet class in Java with Examples | Set 1
- Java.util.Collections.rotate() Method in Java with Examples
- Java.util.Collections.frequency() in Java with Examples
- Java.util.Arrays.equals() in Java with Examples
- Java.util.Collections.disjoint() Method in java with Examples
- Java 8 | Consumer Interface in Java with Examples
- Java.util.LinkedList.poll(), pollFirst(), pollLast() with examples in Java
- Java 8 | ArrayDeque removeIf() method in Java with Examples
- Java lang.Long.lowestOneBit() method in Java with Examples
- Java lang.Long.numberOfTrailingZeros() method in Java with Examples
- Java lang.Long.numberOfLeadingZeros() method in Java with Examples
- Java lang.Long.highestOneBit() method in Java with Examples
- Java lang.Long.byteValue() method in Java with Examples
- Java lang.Long.reverse() method in Java with Examples
- Java Clock tickMinutes() method in Java with Examples
- Java Clock withZone() method in Java with Examples
- Java.util.concurrent.RecursiveAction class in Java with Examples
- Java 8 | BiConsumer Interface in Java with Examples
- Java 8 | IntToDoubleFunction Interface in Java with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.