Question: 1
Given the code fragment:
Which three lines fail to compile?
Question: 2
Given the following code for a Planet object:
What is the output?
Question: 3
You are asked to develop a program for a shopping application, and you are given the following information:
Which definition of the Toy class adds a valid layer of abstraction to the class hierarchy?
Question: 4
Given the following array:
Which two code fragments, independently, print each element in this array?
Question: 5
Given the code fragment:
int[] array = {1, 2, 3, 4, 5};
And given the requirements:
1. Process all the elements of the array in the order of entry.
2. Process all the elements of the array in the reverse order of entry.
3. Process alternating elements of the array in the order of entry.
Which two statements are true?