Reputation: 693
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?
Upvotes: 4
Views: 5596
Reputation: 47913
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.
Upvotes: 2
Reputation: 19339
Comments aren't included in the .class
files, so a decompiler won't be able to produce them.
Upvotes: 1
Reputation: 137398
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.
Upvotes: 9