class Simple2{} public class GetClassMethod { void printName(Object obj){ Class c=obj.getClass(); System.out.println(c.getName()); } public static void main(String args[]){ Simple2 s=new Simple2(); GetClassMethod t=new GetClassMethod(); t.printName(s); } }
No comments:
Post a Comment