سؤال

1.Could I add the comments to my existing java class with the BCEL? 2.Could I add the comments to my newly manually generated java class with the BCEL?

هل كانت مفيدة؟

المحلول

BCEL manipulates byte code. Byte code doesn't contain any comments.

نصائح أخرى

Comments from the Java source code aren't stored in compiled class files (ie bytecode). However you can use annotatons on class, field or method level to store some comments to bytecode. You can also use a custom bytecode attribute to store comments or any other custom information inside bytecode.

Comments are stripped out and ignored by the compiler and not placed in the resulting bytecode (this is probably true for every compiled language). There is no way to put Java comments in bytecode. BCEL won't help you here.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top