`

class 的一些知识

 
阅读更多
public class Class_test {

 /**
  * @param args
  */
 public static void main(String[] args) {
  // TODO Auto-generated method stub
  // 第一部分
         Class_test test = new Class_test();
         String name = test.getclass_1().getName();
          System.out.println(name);
         //第二部分
          String method = class1.class.getMethods()[0].getName();
          System.out.println(method);
          //第三部分
          boolean isInterface = interface1.class.isInterface();
          System.out.println(isInterface);
          new in<entity>(){
   public entity domethod() {
    // TODO Auto-generated method stub
    return null;
   }
           
          };
 }
  public  Class<?> getclass_1(){
    return this.getClass();
  }
}
class class1{
 public void method1(){
   
 }
}

interface interface1{
 
}
interface in<T>{
 T  domethod();
}
class entity{
 public String name;
}

 
 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics