Arrays Java Interview Questions

  1. What is the advantage of arrays in a programming language? (of Arrays Java Interview Questions)
    Arrays avoid the declaration of a number of variables. With one array variable, number of values can be stored, using index numbers.
  2. What are the features of arrays in Java? (of Arrays Java Interview Questions)
    Same rules of C/C++ can be applied mostly.
    1. Stores similar data types.
    2. Contiguous (continuous) memory is allocated for the elements.
    3. All the elements can be accessed with their index numbers where the first element added gets by default 0 index and the second element gets 1 and so on.
    4. Accessing elements with their index number is very fast (have greater performance).
    5. Java supports multi-dimensional arrays and Jagged (variable size) arrays.
    6. Once array is created, its size is fixed. That is, at runtime its size cannot be changed (when the programmer would like to add some more elements which he did not expect at the time of array creation).
    7. With arraycopy() method, copying of one array elements into another is easier.
    8. Arrays are predefined objects in Java. Array objects like other objects, support pass-by-value and pass-by-reference. Programs one one-dimensional and two-dimensional arrays are available.

Pass your comments and suggestions to improve the quality of this tutorial "Arrays Java Interview Questions".

1 thought on “Arrays Java Interview Questions”

Leave a Comment

Your email address will not be published.