为什么不在代码中放置随机的http链接会导致编译错误? [英] Why doesn't putting a random http link in code cause a compilation error?

查看:104
本文介绍了为什么不在代码中放置随机的http链接会导致编译错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如:

public class MyLink{

    public static void main(String[] args) {
        http://google.com

        System.out.println("And this works!");
    }
}

此代码将编译没有任何问题。为什么?

This code will compile without any problems. Why?

推荐答案

在Java中 http:是一个标签,您可以在循环中使用或任何pther语句,而 // google.com 单行注释

In Java http: is a label which you can use in loops or any pther statements, whereas //google.com is a single-line comment.

这篇关于为什么不在代码中放置随机的http链接会导致编译错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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