由于Java中的法律注释中的内容而导致的错误 [英] Error due to content in a legal Comment in Java
问题描述
在此上coderanch链接,我发现以下注释将给编译器错误: -
On this coderanch link, I found that the following comment will give compiler error :-
// Compiler Error due to this Unicode char '\u000a'
原因是,Unicode序列直接替换为它对应的实际字符。因为'\\\ '对应于newLine字符,newLine放置在发现'\\\ '的地方。
Reason being, the Unicode sequence is directly replaced by the actual character it corresponds to. Since '\u000a' corresponds to newLine character, a newLine is placed at the place where '\u000a' is found.
我的问题是,任何其他方式的编译错误由于注释?
My question is that, "Is there any other way of having Compilation Error due to a comment?"
推荐答案
如果您定义一个函数在注释code> @deprecated ),并且你设置你的编译器抛出错误时使用过时的方法(至少内部Eclipse编译器可以配置这是,AFAIK)
IF you define a function a deprecated in a comment (@deprecated
), AND you set your compiler to throw errors when deprecated methods are used (at least the internal Eclipse compiler can be configured this was, AFAIK)
这篇关于由于Java中的法律注释中的内容而导致的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!