class TwoParameterGenericClassDemo
1: //TwoParameterGenericClassDemo.java
3: class TwoParameterGenericClassDemo
4: {
5: public static void main(String args[])
6: {
7: TwoParameterGenericClass<Integer, String> tpgcObject
8: = new TwoParameterGenericClass<Integer, String>
9: (
10: 123,
11: "Hello World!"
12: );
14: System.out.println();
15: tpgcObject.showTypes();
17: //Get and then show the values.
18: int i = tpgcObject.getObject1();
19: System.out.println("Value of T1 object: " + i);
20: String s = tpgcObject.getObject2();
21: System.out.println("Value of T2 object: " + s);
22: }
23: }