错误:参数的非法修饰符 [英] error: Illegal modifier for parameter

查看:145
本文介绍了错误:参数的非法修饰符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用这些代码行...

I was using these lines of code...

public static final int WIDTH = 240;
public static final int HEIGHT = 350;
public static final int SCALE = 2;

但我总是遇到这些错误......

but I always got these errors ...

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 。当地人/参数只能是最终

I expect that you are trying to use public and static on local variable declarations or method parameter declarations. Locals / parameters can only be final.

你只能使用 public static

这篇关于错误:参数的非法修饰符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆