static int a = 1;
static int b = 2;
public static void main(String[] args) throws InterruptedException {
String c = "3";
System.out.println(a+b+c);
}
输出:
33
例题2:
static int a = 1;
static int b = 2;
public static void main(String[] args) throws InterruptedException {
static String c = "3";
System.out.println(a+b+c);
}
输出:
编译报错 static不能再main里