package test;
public class Test101 {
public static void main(String[] args) {
int j = i;
}
}
class Test102 {
int i = 123;
}
i cannot be resolved to a variable
怎么错了?
因为你定义的i不在本类中,且i的权限是默认,test101类无法访问
Test102不能写在那个位置吧
这都根本不在一个类里的变量,你能直接拿到吗?