public class jack {
public static void main(String[] args) {
final int a = 10;//方法内的局部变量a用final修饰
}
static class mike {
public static void main(){
System.out.println(a);
//怎么样才能输出a?
}
}
}
package Learn;
public class jack {
final static int a = 10; //常量声明不要扔到main方法里面
public static void main(String[] args){
mike.main();
}
static class mike {
public static void main(){
System.out.println(a);
}
}
}