首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

泛型方法范例

2012-12-19 
泛型方法实例/** ** @author chase* 2011-04-26 * 泛型方法实例 **/public class ExampleA {public T vo

泛型方法实例

/** *  * @author chase  * 2011-04-26 * 泛型方法实例 *  */public class ExampleA {public <T> void f(T x) {System.out.println(x.getClass().getName());}public static void main(String args[]) {ExampleA ea = new ExampleA();ea.f("");ea.f(23);ea.f("chase");ea.f(3.1415926);ea.f('a');ea.f(ea);}}

?

热点排行