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]#

沒有問題。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM