public class test2 { public static void main(String[] args) { byte a = 10; byte b = 20; byte result = (byte) (a + b); System.out.println(result); }
这是我写的文件,报错的原因是"进行语法分析时已到达文件结尾",经过我观察,发现是其中的括号未补全.以下是我补全后的代码,结果没有报错.
public class test2 { public static void main(String[] args) { byte a = 10; byte b = 20; byte result = (byte) (a + b); System.out.println(result); } }
我的问题就是最后面少了个大括号.