Skip to main content

Please help with generic program. How to add the two integers in this program.

Please note these forums are being decommissioned and use the new and improved forums at
1 reply [Last post]
Joined: 2013-08-06

* @(#)
* @author Sam
* @version 1.00 2013/9/6

public class demoGen {

public demoGen(T t1,T t2) {

public static void main(String[] args) {

demoGen dem=new demoGen(10,15);
demoGen demo=new demoGen("sam is ","good");


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2013-07-10

i think there something wrong with your code you have not declared class T ..........and much more u are just making code complex like this..................