编译.java时出错? (去) [英] Errors compiling a .java? (goto)

查看:87
本文介绍了编译.java时出错? (去)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到了这个 .java ,我想将其编译为 .class .唯一的问题是实际制作此代码的人使用了非常草率的代码.我遇到了14个错误,它们都是一样的.有3条线都有所有错误.它们都有相同的错误,唯一的是我不知道如何解决它们.

I got this .java and i want to compile it to a .class. The only thing is that the guy who actually made this used very sloppy code. I got 14 errors and they're all the same. There are 3 lines that have all the errors. They all have the same errors and the only thing is I don't know how to fix them.

带有错误示例的代码:

if(!i$.hasNext()) 
    goto L2;
else 
    goto L1;

错误在goto处显示iS,并表示illegal start of expression.那是第一个错误.

The error has iS at the goto and is saying illegal start of expression. That's the first error.

  • 另一个是L2所在的位置,并说not a statement.
  • 然后在其他地方再次显示'else without 'if'.
  • 再加上goto非法表达的开始.
  • Another is where the L2 is and is saying not a statement.
  • And again at the else it says 'else without 'if'.
  • And again with the goto illegal start of expression.

我也知道goto甚至不是一个语句,它是保留的,没有使用,部分原因是它没有在Java中使用!但是,如果有人知道除goto之外的其他声明,这些声明会链接回标签,请告诉我,我将不胜感激!

I also know that goto isn't even a statement, its reserved and isn't used, partly because it is not used in java! But if there is anyone out there who knows a statement other than goto which will link back to a label please tell, I will be much grateful!

更新:我可以指出我没有这么做.

Update: May I point out that I did not make this.

推荐答案

goto不在Java中实现.它是保留关键字,但不执行任何操作.

goto is not implemented in java. it is a reserved keyword but does not do anything.

此问题曾被问过:

Java中是否有goto语句?

这篇关于编译.java时出错? (去)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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