2015-09-05 35 views
-2

我怎樣才能修復Java此錯誤:錯誤:18的Java IDE

java.lang.ExceptionInInitializerError 
Caused by: java.lang.RuntimeException: Uncompilable source code - class EnumTest 
is public, should be declared in a file named EnumTest.java 
at EnumTest.<clinit>(Day.java:18) 
Exception in thread "main" Java Result: 1 

please help me[![enter image description here][1]][1] [1]:

+0

你能否在問題本身提供[mcve]? – NightShadeQueen

回答

2

你需要讓你的公共類定義了自己的類文件。將該類移到名爲EnumTest.java的文件中。