Question 96
Given the code fragment:
You have been asked to define the ProductCode class. The definition of the ProductCode class must allow c1
instantiation to succeed and cause a compilation error on c2 instantiation.
Which definition of ProductCode meets the requirement?
Question 97
Given:
public class Foo<K, V> {
private K key;
private V value;
public Foo (K key, V value) (this.key = key; this value = value;)
public static <T> Foo<T, T> twice (T value) (return new Foo<T, T>
(value, value); )
public K getKey () (return key;)
public V getValue () (return value;)
}
Which option fails?
Question 98
Given the code fragment:
What is the result?
Question 99
Given the code fragment:
What is the result?
Question 100
Which two code blocks correctly initialize a Locale variable?
