I have a doubt related to the intermediate bytecode (.class files) generated when inheritance is involved in the scene. Please consider the below code:
Dog.java
After compiling Dog.java, 2 class files are generated: Animal.class and Dog.class.
Animal.class file contains the bytecode of Animal class. Till this point, everything is fine.
Now, my question goes like this:
What are the contents of Dog.class file? Does Dog.class contains the bytecode only related to Dog class or it includes the bytecode of Animal class as well i.e. Bytecode of Animal + Bytecode of Dog? (Animal class being super class of Dog class)
Dog.java
After compiling Dog.java, 2 class files are generated: Animal.class and Dog.class.
Animal.class file contains the bytecode of Animal class. Till this point, everything is fine.
Now, my question goes like this:
What are the contents of Dog.class file? Does Dog.class contains the bytecode only related to Dog class or it includes the bytecode of Animal class as well i.e. Bytecode of Animal + Bytecode of Dog? (Animal class being super class of Dog class)