This commit is contained in:
Aditya Tiwari
2026-02-05 13:53:06 +05:30
parent bf10bb1f53
commit 1d7f4992d3
3 changed files with 12 additions and 0 deletions

BIN
GenericClass9A.class Normal file

Binary file not shown.

12
GenericClass9A.java Normal file
View File

@@ -0,0 +1,12 @@
// write a program for Generic class
public class GenericClass9A <T1, T2> {
public void display (T1 var1, T2 var2){
System.out.println("Name: "+var1 + " ID: " + var2);
}
public static void main(String[] args){
GenericClass9A<String, Integer> obj1 = new GenericClass9A<String, Integer>();
GenericClass9A<Integer, Integer> obj2 = new GenericClass9A<Integer, Integer>();
obj1.display("Aditya", 54);
obj2.display(67, 68);
}
}

BIN
src/9A.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB