我的java代码有一个明显的错误。为什么要编译并运行? [英] My java code has an obvious error. Why does it compile and run?

查看:112
本文介绍了我的java代码有一个明显的错误。为什么要编译并运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

public class HelloWorld {
    public static void main (String args[]){
        System.out.println ("Hello ");
        http://www.google.com
        System.out.println ("World!");
    }
}

上面的代码只是编译并执行正常。为什么编译器没有报告任何错误?

The above code is just compiling and executing fine. Why the compiler is not reporting any error?

推荐答案

http:标签声明。另请参见此处

然后将 // www.google.com 部分解释为 // 评论。

The //www.google.com portion is then interpreted as a // comment.

这篇关于我的java代码有一个明显的错误。为什么要编译并运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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