我正在使用这些代码行...
public static final int WIDTH = 240;
public static final int HEIGHT = 350;
public static final int SCALE = 2;
但我总是遇到这些错误......
Illegal modifier for parameter WIDTH; only final is permitted
Illegal modifier for parameter HEIGHT; only final is permitted
Illegal modifier for parameter SCALE; only final is permitted
最佳答案
我希望您尝试在局部变量声明或方法参数声明上使用 public
和 static
。局部变量/参数只能是final
。
您只能在类成员(或类似成员)上使用 public
和 static
。
关于java - 错误: Illegal modifier for parameter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15747231/