I have been working on Java programming language for a long, but there is always something new that I come across. These behaviors are taken for granted at times.
This one is what happens to comments in the Java source file, when we compile the source code and create a .class file!!
The standard Java compiler strips all the comments and uses only pure Java statements to create the .class file. I guess, there is no provision in the JVM byte code to retain the comments.
So, add as much comments in Java source files to make them readable and maintainable as you like without worrying about the size of .class file that JVM has to load and execute at runtime.
Till next, take care.
This one is what happens to comments in the Java source file, when we compile the source code and create a .class file!!
The standard Java compiler strips all the comments and uses only pure Java statements to create the .class file. I guess, there is no provision in the JVM byte code to retain the comments.
So, add as much comments in Java source files to make them readable and maintainable as you like without worrying about the size of .class file that JVM has to load and execute at runtime.
Till next, take care.
No comments:
Post a Comment