범용 방법 실례

506 단어 F#
/**
 * 
 * @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);
	}
}

좋은 웹페이지 즐겨찾기