Hi,
I'm learning
Java basics and while playing around with inheritance, I found something that I cannot understand.
(Below) I created two classes (class1 and class2) and class2 extends class1. Now, when I instantiate an object of sub class2 in my main method and run the code both constructors are run, because I'm seeing the println statements from both class' constructors in my output.
Is it just a simple fact that when you instantiate an object that extends another object, it runs both child and parent constructors? Maybe I'm missing something.