I have a file called One.java that has only one commented line. I compiled it to produce the class file One.class and Renamed it as old.class. Then, I opened One.java, introduced five more commented lines and compiled it again to produce One.class. Both the class files had the same size, but when I ran diff on them like:
diff One.class old.class
I got the output:
Binary files One.class and old.class differ
This is my One.java file:
// One.java
class One
{
public static void main(String [] args)
{
System.out.println("Hello Java world");
}
}
and this is my revised One.java (with additional lines of comment):
// One.java
// One.java
// One.java
// One.java
// One.java
// One.java
class One
{
public static void main(String [] args)
{
System.out.println("Hello Java world");
}
}
I am using Java SE 10 on an iMac running High Sierra.
Debugging symbols; basically the code includes line numbers and other metadata for debugging. You can examine it yourself with javap -v One.class and javap -v old.class
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With