3 - Arrays
Enroll to start learning
You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.
Practice Questions
Test your understanding with targeted questions
What is the size of the following array after declaration? int[] arr = new int[10];
💡 Hint: 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};?
💡 Hint: Consider what the index of the third element would be.
4 more questions available
Interactive Quizzes
Quick quizzes to reinforce your learning
What is the value of the first element in an array int[] arr = {10, 20, 30};?
💡 Hint: 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.
💡 Hint: Consider how arrays allocate memory at the time of declaration.
2 more questions available
Challenge Problems
Push your limits with advanced challenges
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.
💡 Hint: 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.
💡 Hint: Think about swapping elements from the start with those from the end.
Get performance evaluation
Reference links
Supplementary resources to enhance your learning experience.