Can Java comments be seen by decompiling?

守給你的承諾、 提交于 2019-12-13 14:57:18

问题


I was wondering if I put comments in my code and when someone tried to decompile it, if they could read the comments that I put?


回答1:


No, comments are never included as part of the compilation process. They are typically removed in some sort of pre-processing, or first-pass stage.




回答2:


Nope, comments are discarded by the compiler.




回答3:


No. And you can verify this by using DJ Java Decompiler, for example. If you also refer to the Java Class File Format, you'll see there's no construct for storing comments.




回答4:


Comments aren't included in the .class files, so a decompiler won't be able to produce them.



来源:https://stackoverflow.com/questions/8798002/can-java-comments-be-seen-by-decompiling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!