我正在编写一个简单的两文件项目。我想知道为什么第二个文件无法从主类读取和打印数据。我知道反过来也可能发生。请为我澄清这一点。吨
测试.java
package testme;
public class Test {   
     int a = 7;    
     public int getA() { return a; }
     public static void main( String args[] ) { 
         Test test = new Test();
     }     
}  
Testit.java
package testme;
public class Testit {    
    Test t;    
    Testit() {
       t = new Test(); 
       System.out.println( t.getA() );
    }   
}