我在错误列表中看到此错误,但似乎无法找到解决方法。我尝试的一切似乎都没有效果。
if (this.mouseX >= 522 + paddingX + (clientSize >= 1 ? 3 - (this.longTabs ? 240 : 0) : 0)) {
if (this.mouseX <= 762 + paddingX + (clientSize >= 1 ? 3 - (this.longTabs ? 240 : 0) : 0)) {
if (this.mouseY >= '©' + (clientSize >= 1 ? 261 + (this.longTabs ? 37 : 0) : 0) + paddingY) {
if (this.mouseY < '�' + (clientSize >= 1 ? 261 + (this.longTabs ? 37 : 0) : 0) + paddingY) {
break label244; } //Where the error is
}
}
}
}
但是这里设置了label244:
{
int i;
label244: i = 0;
for (int x = 0; i < 8; x += 30)
{
能否通过一些示例告诉我如何解决这些问题?我还剩下 17 个这样的错误。
最佳答案
来自Java Language Specification #14.7 (强调我的)
[...] Java programming language has no
goto
statement; identifier statement labels are used withbreak
(§14.15) orcontinue
(§14.16) statements appearing anywhere within the labeled statement.The scope of a label of a labeled statement is the immediately contained Statement.
这意味着标签
label244: i = 0;
仅影响i=0
。换句话说,它类似于
label244: {
//here you can use label
i = 0;
}
//but here label is no longer accessible.
因此在此范围之外它不可见/不可访问。
如果您想在 for
范围内使用它,请将其放在它之前(将其移到 i = 0;
之后)。
int i;
i = 0;
label244:
for (int x = 0; i < 8; x += 30)
{
//...
}
关于Java "The label Label244 is missing"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23963218/