Would you like to react to this message? Create an account in a few clicks or log in to continue.

A simple generic class in Java v. 5.0

Go down

A simple generic class in Java v. 5.0 Empty A simple generic class in Java v. 5.0

ตั้งหัวข้อ  Admin Thu May 22, 2008 2:05 am


//A simple generic class in Java v. 5.0
class Gen<T> {
T ob; // declare an object of type T
// class Constructor
Gen(T o) { ob = o; }
// the Get method
T getob() { return ob; }
}

//Show type of T
void showType() {
System.out.println("Type of T is " + ob.getClass().getName()); }
}// End of class

Admin
Admin
Admin

จำนวนข้อความ : 112
Registration date : 18/05/2008

http://chawban.chocoforum.com

ขึ้นไปข้างบน Go down

ขึ้นไปข้างบน

- Similar topics

 
Permissions in this forum:
คุณไม่สามารถพิมพ์ตอบ