问题
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