Anonymous Array – An array without a name is called anonymous array
e.g. Going somewhere and ask a person about the address. But you don’t know who was that person. The person is anonymous.
– The main purpose of the anonymous array is just for instant use.
Array – An array is an indexed collection of a fixed number of homogeneous data elements.
1. Instead of creating multiple int, float variable, we can assign into 1 called an Array
2. Array size is fixed. If we assigned 10000 and at runtime only 2 comes then 99998 space is wasted or vice-versa. Do we must know the size in advance if we want to use an array.
3. An array can contain the only same type of data types. This problem has come over in collection concept.
1. At the time of array creation, we should mention the size of the array
2. It is illegal to have array size 0 in java
3. The runtime exception will come if you pass negative size array.
4. Byte, short, char, it is allowed to specify the size of the array.
5. Maximum allowed array size in Java 2147483647 which is max value of int data type