Array Flashcards
(90 cards)
A _____________ is a way of organizing and
storing data so that it can be accessed and
modified efficiently.
data structure
________ in Java are __________(consisting of
parts all of the same kind.) data structures
implemented in Java as objects.
Arrays
homogeneous
A specific element in an array is accessed by its
_______. Arrays offer a convenient means of grouping
related information.
index
An ________ in an array is a single value stored at a
particular position. Each element shares the same
data type as the array.
element
An __________ is the position of anelement inside an array. In Java, array indices start from 0 (not 1).
index (plural: indices)
A __________ is the physical address in
computer memory (RAM) where an array stores its
elements.
memory location
What are the typesof Java Array
Single Dimensional Array
Double Dimensional Array
Multi Dimensional Array
You can imagine a 1D array as a row, where elements are stored one
after another.
Single Dimensional Arrays
A two-dimensional (2D) array can be visualized as a table or a matrix. It contains rows and columns.
Double Dimensional Arrays
Each element is initialized to a default value, a process known as _________. ____________ is initialization of variables to a default value, as in the initialization of array elements when an array is __________.
auto-initialization
Auto-Initialization
constructed
A ______________ in Java
is a structured way of storing multiple
values of the same data type under a
single variable name.
one-dimensional array (1D array)
The enhanced for loop, also called the _______, is a simplified way to iterate through arrays and collections. It eliminates the need for index tracking, making the code cleaner and easier to read.
for each loop
Accessing an index that is outside the valid range of the array causes a
runtime error.
Array Index Out of Bounds Exception
Arrays have a fixed size—once created, they cannot grow or
shrink.
Fixed Size Limitation
Java provides various utility methods to work with
arrays through the Arrays class in the java.util
package. These methods help with______,
_______, _____, _______, and _________
arrays efficiently.
sorting
searching
copying
comparing
filling
The equals() method checks if
two arrays contain the same
elements in the same order.
Arrays.equals()
The sort() method sorts an array in
ascending order.
Arrays.sort() –
The fill() method sets all elements in an array to a
specific value.
Arrays.fill()
The copyOf() method creates a new array with the
same elements as the original.
Arrays.copyOf()
is used to
search for an element in a sorted array efficiently.
Arrays.binarySearch() method
method is used
to convert a String into a
character array (char[])
toCharArray()
A ________ is an array of arrays.
It stores data in rows and columns
(tabular format).
2D array
Elements are accessed using two
indices: row index and column index.
Also called __________
because they use more than one
dimension (row and column).
multidimensional arrays
Elements are stored row by row in
memory.
Row-Major Order