- Java.util - WeakHashMap
- Java.util - Vector
- Java.util - UUID
- Java.util - TreeSet
- Java.util - TreeMap
- Java.util - TimeZone
- Java.util - TimerTask
- Java.util - Timer
- Java.util - StringTokenizer
- Java.util - Stack
- Java.util - SimpleTimeZone
- Java.util - ServiceLoader
- Java.util - Scanner
- Java.util - ResourceBundle.Control
- Java.util - ResourceBundle
- Java.util - Random
- Java.util - PropertyResourceBundle
- Java.util - PropertyPermission
- Java.util - Properties
- Java.util - PriorityQueue
- Java.util - Observable
- Java.util - Locale
- Java.util - ListResourceBundle
- Java.util - LinkedList
- Java.util - LinkedHashSet
- Java.util - LinkedHashMap
- Java.util - IdentityHashMap
- Java.util - Hashtable
- Java.util - HashSet
- Java.util - HashMap
- Java.util - GregorianCalendar
- Java.util - Formatter
- Java.util - EnumSet
- Java.util - EnumMap
- Java.util - Dictionary
- Java.util - Date
- Java.util - Currency
- Java.util - Collections
- Java.util - Calendar
- Java.util - BitSet
- Java.util - Arrays
- Java.util - ArrayList
- Java.util - ArrayDeque
- Java.util - Home
Java.util Package Extras
- Java.util - Discussion
- Java.util - Useful Resources
- Java.util - Enumerations
- Java.util - Exceptions
- Java.util - Interfaces
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Java Arrays - Class
Introduction
The Java Arrays class contains a static factory that allows arrays to be viewed as psts. Following are the important points about Arrays −
This class contains various methods for manipulating arrays (such as sorting and searching).
The methods in this class throw a NullPointerException if the specified array reference is null.
Class declaration
Following is the declaration for java.util.Arrays class −
pubpc class Arrays extends Object
Class methods
Sr.No. |
Method & Description |
---|---|
1 |
This method returns a fixed-size pst backed by the specified array. |
2 |
This method searches the specified array of bytes for the specified value using the binary search algorithm. |
3 |
This method searches the specified array of chars for the specified value using the binary search algorithm. |
4 |
This method searches the specified array of doubles for the specified value using the binary search algorithm. |
5 |
This method searches the specified array of floats for the specified value using the binary search algorithm. |
6 |
This method searches the specified array of ints for the specified value using the binary search algorithm. |
7 |
This method searches a range of the specified array of longs for the specified value using the binary search algorithm. |
8 |
This method searches the specified array for the specified object using the binary search algorithm. |
9 |
This method searches the specified array of shorts for the specified value using the binary search algorithm. |
10 |
This method searches the specified array for the specified object using the binary search algorithm. |
11 |
This method compares two boolean arrays lexicographically. |
12 |
This method compares two byte arrays lexicographically. |
13 |
This method compares two char arrays lexicographically. |
14 |
This method compares two double arrays lexicographically. |
15 |
This method compares two float arrays lexicographically. |
16 |
This method compares two int arrays lexicographically. |
17 |
This method compares two long arrays lexicographically. |
18 |
This method compares two short arrays lexicographically. |
19 |
This method compares two Object arrays lexicographically. |
20 |
This method compares two byte arrays lexicographically, numerically treating elements as unsigned. |
21 |
This method compares two int arrays lexicographically, numerically treating elements as unsigned. |
22 |
This method compares two long arrays lexicographically, numerically treating elements as unsigned. |
23 |
This method compares two short arrays lexicographically, numerically treating elements as unsigned. |
24 |
This method copies the specified array, truncating or padding with false (if necessary) so the copy has the specified length. |
25 |
This method copies the specified array, truncating or padding with false (if necessary) so the copy has the specified length. |
26 |
This method copies the specified array, truncating or padding with false (if necessary) so the copy has the specified length. |
27 |
This method copies the specified array, truncating or padding with false (if necessary) so the copy has the specified length. |
28 |
This method copies the specified array, truncating or padding with zeros (if necessary) so the copy has the specified length. |
29 |
This method copies the specified array, truncating or padding with zeros (if necessary) so the copy has the specified length. |
30 |
This method copies the specified array, truncating or padding with zeros (if necessary) so the copy has the specified length. |
31 |
This method copies the specified array, truncating or padding with zeros (if necessary) so the copy has the specified length. |
32 |
This method copies the specified array, truncating or padding with nulls (if necessary) so the copy has the specified length. |
33 |
This method copies the specified array, truncating or padding with nulls (if necessary) so the copy has the specified length. |
34 |
This method copies the specified range of the specified array into a new array. |
35 |
This method copies the specified range of the specified array into a new array. |
36 |
This method copies the specified range of the specified array into a new array. |
37 |
This method copies the specified range of the specified array into a new array. |
38 |
This method copies the specified range of the specified array into a new array. |
39 |
This method copies the specified range of the specified array into a new array. |
40 |
This method copies the specified range of the specified array into a new array. |
41 |
This method copies the specified range of the specified array into a new array. |
42 |
This method copies the specified range of the specified array into a new array. |
43 |
This method returns true if the two specified arrays are deeply equal to one another. |
44 |
This method returns a hash code based on the "deep contents" of the specified array. |
45 |
This method returns a string representation of the "deep contents" of the specified array. |
46 |
This method returns true if the two specified arrays of booleans are equal to one another. |
47 |
This method returns true if the two specified arrays of bytes are equal to one another. |
48 |
This method returns true if the two specified arrays of chars are equal to one another. |
49 |
This method returns true if the two specified arrays of double are equal to one another. |
50 |
This method returns true if the two specified arrays of floats are equal to one another. |
51 |
This method returns true if the two specified arrays of ints are equal to one another. |
52 |
This method returns true if the two specified arrays of longs are equal to one another. |
53 |
This method returns true if the two specified arrays of shorts are equal to one another. |
54 |
This method returns true if the two specified arrays of Objects are equal to one another. |
55 |
This method returns true if the two specified arrays of Objects are equal to one another. |
56 |
This method assigns the specified boolean value to each element of the specified array of booleans. |
57 |
This method assigns the specified byte value to each element of the specified array of bytes. |
58 |
This method assigns the specified char value to each element of the specified array of chars. |
59 |
This method assigns the specified double value to each element of the specified array of doubles. |
60 |
This method assigns the specified float value to each element of the specified array of floats. |
61 |
This method assigns the specified int value to each element of the specified array of ints. |
62 |
This method assigns the specified long value to each element of the specified array of longs. |
63 |
This method assigns the specified Object reference to each element of the specified array of Objects. |
64 |
This method assigns the specified short value to each element of the specified array of shorts. |
65 |
This method returns a hash code based on the contents of the specified array. |
66 |
This method finds and returns the index of the first mismatch between two boolean arrays, otherwise return -1 if no mismatch is found. |
67 |
This method finds and returns the index of the first mismatch between two byte arrays, otherwise return -1 if no mismatch is found. |
68 |
This method finds and returns the index of the first mismatch between two char arrays, otherwise return -1 if no mismatch is found. |
69 |
This method finds and returns the index of the first mismatch between two double arrays, otherwise return -1 if no mismatch is found. |
70 |
This method finds and returns the index of the first mismatch between two int arrays, otherwise return -1 if no mismatch is found. |
71 |
This method finds and returns the index of the first mismatch between two long arrays, otherwise return -1 if no mismatch is found. |
72 |
This method finds and returns the index of the first mismatch between two short arrays, otherwise return -1 if no mismatch is found. |
73 |
This method finds and returns the index of the first mismatch between two object arrays, otherwise return -1 if no mismatch is found. |
74 |
This method finds and returns the index of the first mismatch between two object arrays, otherwise return -1 if no mismatch is found. |
75 |
This method cumulates, in parallel, each element of the given array in place, using the suppped function. |
76 |
This method cumulates, in parallel, each element of the given array in place, using the suppped function. |
77 |
This method cumulates, in parallel, each element of the given array in place, using the suppped function. |
78 |
This method cumulates, in parallel, each element of the given array in place, using the suppped function. |
79 |
This method sets all elements of the specified array, in parallel, using the provided generator function to compute each element. |
80 |
This method sets all elements of the specified array, in parallel, using the provided generator function to compute each element. |
81 |
This method sets all elements of the specified array, in parallel, using the provided generator function to compute each element. |
82 |
This method sets all elements of the specified array, in parallel, using the provided generator function to compute each element. |
83 |
This method sorts the specified array of bytes into ascending numerical order. |
84 |
This method sorts the specified array of chars into ascending numerical order. |
85 |
This method sorts the specified array of doubles into ascending numerical order. |
86 |
This method sorts the specified array of floats into ascending numerical order. |
87 |
This method sorts the specified array of ints into ascending numerical order. |
88 |
This method sorts the specified array of longs into ascending numerical order. |
89 |
This method sorts the specified array of shorts into ascending numerical order. |
90 |
This method sorts the specified array of objects into ascending order, according to the natural ordering of its elements. |
91 |
This method sorts the specified array of objects into ascending order, according to the ordering provided by the Comparator instance. |
92 |
This method sets all elements of the specified array, using the provided generator function to compute each element. |
93 |
This method sets all elements of the specified array, using the provided generator function to compute each element. |
94 |
This method sets all elements of the specified array, using the provided generator function to compute each element. |
95 |
This method sets all elements of the specified array, using the provided generator function to compute each element. |
96 |
This method returns a Sppterator.OfDouble covering all of the specified array. |
97 |
This method returns a Sppterator.OfInt covering all of the specified array. |
98 |
This method returns a Sppterator.OfLong covering all of the specified array. |
99 |
This method returns a Sppterator covering all of the specified array. |
100 |
This method returns a sequential DoubleStream with the specified array as its source. |
101 |
This method returns a sequential IntStream with the specified array as its source. |
102 |
This method returns a sequential LongStream with the specified array as its source. |
103 |
This method returns a sequential Stream with the specified array as its source. |
104 |
This method sorts the specified array of bytes into ascending numerical order. |
105 |
This method sorts the specified array of chars into ascending numerical order. |
106 |
This method sorts the specified array of doubles into ascending numerical order. |
107 |
This method sorts the specified array of floats into ascending numerical order. |
108 |
This method sorts the specified array of ints into ascending numerical order. |
109 |
This method sorts the specified array of longs into ascending numerical order. |
110 |
This method sorts the specified array of objects into ascending order, according to the natural ordering of its elements. |
111 |
This method sorts the specified array of shorts into ascending numerical order. |
112 |
This method sorts the specified array of objects according to the order induced by the specified comparator. |
113 |
This method returns a string representation of the contents of the specified array of boolean. |
Methods inherited
This class inherits methods from the following classes −
java.util.Object