Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What is the size of the following array after declaration? int[] arr = new int[10];
Recall that the size is specified during declaration.
How do you access the third element of the array int[] arr = {1, 2, 3, 4, 5};?
Consider what the index of the third element would be.
What is the value of the first element in an array int[] arr = {10, 20, 30};?
Think about what element is stored at the starting index.
True or False: The size of an array can be changed after it is declared.
Consider how arrays allocate memory at the time of declaration.
Implement a function in Java that takes an array and a value and returns the index of that value, or -1 if it's not found.
Consider using a loop to check each element for a match.
Given an array int[] arr = {1, 2, 3, 4, 5}, write code to reverse the array in-place.
Think about swapping elements from the start with those from the end.
6 more questions in this section. Enroll free to practise them all.
Enroll free