error: reached end of file while parsing


1、java编译报错

error: reached end of file while parsing

2、出现这种报错的原因是括号没有成对,检查源代码:

补全括号,保存退出:

3、再次编译、执行

[root@centos7 test5]# ls
test.java
[root@centos7 test5]# javac test.java
[root@centos7 test5]# ls
Shuffle1.class  test.java
[root@centos7 test5]# java Shuffle1
a-b c-d[root@centos7 test5]#

没有问题。