0

DebugMode在一个单独的文件中有枚举DebugMode.java

package core;
public enum DebugMode {
    Disabled, Console, Dialog, All
}

然后我DebugDebug.java.

package core;

public class Debug {
    private static DebugMode debug = DebugMode.All;
    public static void Message(String str) {
        //some unrelated stuff
    }
}

但由于某种原因,它给了我这个字符串的错误:

private static DebugMode debug = DebugMode.All;

错误是:

Caused by: java.lang.RuntimeException: Uncompilable source code - class DebugMode is public, should be declared in a file named DebugMode.java
    at core.DebugMode.<clinit>(Debug.java:6)
    ... 3 more
Java Result: 1

我只是不明白是什么问题......有人可以帮我解决这个问题吗?

4

0 回答 0