The amazing thing about Java

简介: The amazing thing about Java

正文


猜猜下面的代码能否输出?


/**
 * @author breakpoint/赵先生 <zlgtop@163.com>
 * create on 2022/05/28
 */
public class Mytest001 {
    public static void main(String[] args) {
        // \u000d System.out.println("hello word");
    }
}


答案当然是肯定的!!!!!!


下面说一说是为啥?


实际上,在我们的代码中,有一个特殊的字符`\u000d`


这个是一个特殊的Unicode码. 在java中表示换行的意思.所以,我们定义的那一行注释并没有真正的注释!!!!

Java的编译器不仅仅会编译代码,而且也会解析Unicode代码!!!

相关文章
|
3月前
|
设计模式 Java API
【Java】Best coding practices every java developer should
【Java】Best coding practices every java developer should
55 0
|
5月前
|
设计模式 Java Unix
【Java】Best coding practices every java developer should(一)
【Java】Best coding practices every java developer should
40 0
|
5月前
|
IDE Java 程序员
【Java】Best coding practices every java developer should(二)
【Java】Best coding practices every java developer should
34 0
|
前端开发 Java
java:How to use variable parameter? (easy to understand)
It's the first time to write a blog in English for me. (About variable parameter)
70 0
java:How to use variable parameter? (easy to understand)
|
分布式计算 安全 Java
JDK15 is coming,Do you konw the new features of java8?(下)
JDK15 is coming,Do you konw the new features of java8?(下)
59 0
|
JavaScript Java 容器
JDK15 is coming,Do you konw the new features of java8?(上)
JDK15 is coming,Do you konw the new features of java8?(上)
66 0
成功解决RuntimeError: Java is not installed, or the Java executable is not on system path
成功解决RuntimeError: Java is not installed, or the Java executable is not on system path
|
Java
解决bug:项目配置java8时出现Error:Jack is required to support java 8 language features...
解决bug:项目配置java8时出现Error:Jack is required to support java 8 language features...
247 0
解决bug:项目配置java8时出现Error:Jack is required to support java 8 language features...
|
Java Scala
function implemented in Scala - compiled java code - some closure example
function implemented in Scala - compiled java code - some closure example
91 0
function implemented in Scala - compiled java code - some closure example
|
Java 编译器