如果您有这样的程序:
public class ABC
{
public static void main(String args[])
{
System.out.println("1");
http://example.com
System.out.println("2");
}
}
Run Code Online (Sandbox Code Playgroud)
请注意在http://example.com两个输出语句之间写入的URL .
为什么程序编译没有任何错误?
在某个地方浏览java好文章,我发现这样的代码完美编译.
public int myMethod(){
http://www.google.com
return 1;
}
Run Code Online (Sandbox Code Playgroud)
描述说http:该词将被视为标签和//www.google.com评论
我不知道Java Label在循环外是如何有用的?在什么情况下应该使用Java Label外部循环?
java ×2