java静态方法访问非静态方法

来源:互联网 发布:大学生适合开淘宝店吗 编辑:程序博客网 时间:2024/05/26 12:05
class test{      public static void main(String args[]){                         System.out.println(new test1().methodname());               }     }  //非静态方法class test1{      public String methodname(){          System.out.println("调用了非静态方法");      }  }    
原创粉丝点击