标签:problem 5.5 必须 java 提示 exce out read string
例如:
public static final String str = "我终身不可变";
public static void main(String[] args) { int x; x = 20; // 为x赋值20 System.out.println(x);// 读取x变量中的值,再打印 }
public static void main(String[] args) { int x = 20; { int y = 20; } System.out.println(x);//读取x变量中的值,再打印 System.out.println(y);//读取y变量中的值失败,失败原因,找不到y变量,因为超出了y变量作用范围,所以不能使用y变量 } 错误提示:Exception in thread "main" java.lang.Error: Unresolved compilation problem
public static void main(String[] args) { int x = 10; double x = 5.5;// 编译失败,变量重复定义 } 错误提示:Exception in thread "main" java.lang.Error: Unresolved compilation problem
标签:problem 5.5 必须 java 提示 exce out read string
原文地址:https://www.cnblogs.com/Change97/p/9372077.html