Can Java comments be seen by decompiling?

前端 未结 4 1965
再見小時候
再見小時候 2021-01-19 07:33

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?

相关标签:
4条回答
  • 2021-01-19 08:11

    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.

    0 讨论(0)
  • 2021-01-19 08:20

    Nope, comments are discarded by the compiler.

    0 讨论(0)
  • 2021-01-19 08:33

    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.

    0 讨论(0)
  • 2021-01-19 08:36

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

    0 讨论(0)
提交回复
热议问题