| 
 
| class Demo1{ public static void main(String[] args){
 Demo1 demo = new Demo1(3):
 int j = demo.getI();
 System.out.println(j);
 }
 }
 class  Demo2{
 private int i;
 public Demo2(){
 }
 public Demo2(int i){
 this.i = i;
 public int getI(){
 return i;
 }
 }
 
 不是说静态方法中只能访问静态的成员吗?在上列中在静态main方法中不是调用了非静态的getI()方法吗?求解?
 
 | 
 |