Question 1
Given: What is the result?
- 2-4
- 0-6 1-5 2-4
- 1-5
- 1-5 2-4
- The compilation fails due to an error in line 1.
- 0-6
- 0-6 2-4
Question 2
Given: What is the result?
- 5 4 3 2 1
- 5
- nothing
- 5 4 3 2 1 4 3 2 1 3 2 1 2 1 1
Question 3
Given: and Which two method definitions at line n1 in the Bar class compile? (Choose two.)
- public List<Number> foo(Set<String> m) {...}
- public List<Integer> foo(Set<CharSequence> m) {...}
- public List<Integer> foo(TreeSet<String> m) {...}
- public List<Object> foo(Set<CharSequence> m) {...}
- public ArrayList<Integer> foo(Set<String> m) {...}
- public ArrayList<Number> foo(Set<CharSequence> m) {...}
Question 4
Given: What is the result?
- 5
- 4
- 3
- An exception is thrown at runtime
Question 5
Given the code fragment: What is the result?
- 0 8 10
- 0
- The code prints nothing.
- 0 4 9
- 0 8