A generic class is defined below. Complete the program as told by the comments. public class Example { private T1 number; private T2 description; I -- define the method setExampleData() to set both...


A generic class is defined below. Complete the program as told by the comments.<br>public class Example <T1,T2> {<br>private T1 number;<br>private T2 description;<br>I -- define the method setExampleData() to set both variables-<br>public void setExampleData (T1 n, T2 d){<br>[1]<br>[2]<br>}<br>public static void main( [3] ) { // arguments<br>create an object obj1 by parameters Integer and String-<br>---<br>[4]<br>-call the setExampleData() method--<br>[5]<br>}<br>}<br>

Extracted text: A generic class is defined below. Complete the program as told by the comments. public class Example { private T1 number; private T2 description; I -- define the method setExampleData() to set both variables- public void setExampleData (T1 n, T2 d){ [1] [2] } public static void main( [3] ) { // arguments create an object obj1 by parameters Integer and String- --- [4] -call the setExampleData() method-- [5] } }

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here