Site Search:

OCPJP Simulation Test 44

<Back to OCPJP





Question: Suppose the following methods are defined within a generic class
public class<T t> test{...}
Which of the following code snippets compile?

Choice:
A. public static <T>void grab(T t) {}
B. public static <T>T self(T t) {return t;}
C. public static <T, S> T process(T t, S s) {return t;}
D. public static <T> T processes(T t, S s) {return t;}
E. public void takes(T t) {}
F. public static void grabs(T t) {}
G.public T check(T t) {return t;}
H. public <T>T checks(T t) {return t;}