Collections and Generics
© examsiri.com
Question : 4 of 53
Marks:
+1,
-0
Place code into the class so that it compiles and generates the output answer=42. Note: Code options may be used more than once.
Code Options
1) Gen < T >
2) Gen < ? >
3) Gen
4) ?
5) T
Class
public class (1)_______{
  private (2)_____ object;
  public (3)_____ ((4)____ object) {
   this.object = object;
  }
  public (5)______ get Object() {
   return object;
  }
  public static void main(String[] args) {
   Gen < String > str = new Gen < String > ("answer");
   Gen < Integer > intg = new Gen < Integer > (42);
   System.out.println(str.getObject() + "=" + intg.getObject());
  }
}Code Options
1) Gen < T >
2) Gen < ? >
3) Gen
4) ?
5) T
Go to Question: