Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What does int[] numbers = new int[5]; do?
What kind of data structure is an array?
Why is memory allocation important?
What happens if we don’t allocate memory for our array?
What does the declaration int[] numbers; do?
What does this statement do on its own?
True or False: The statement int[] numbers = new int[5]; both declares and initializes the array.
What does this statement achieve with both parts?
Create a class method that takes a size as an argument and returns an initialized array of integers filled with zeros.
Think about what initial value you’d like to fill the array with.
Given a situation where memory allocation fails, what are some fallback methods that can be implemented?
Consider what happens when the system runs out of memory.
4 more questions in this section. Enroll free to practise them all.
Enroll free