• Post Reply Bookmark Topic Watch Topic
  • New Topic

Please suggest me why im getting sysouts of super class  RSS feed

 
rajanikanth bhagavan kanth
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Can you please tell me why im getting the sysouts of the base class in the below code

 
Mark Vedder
Ranch Hand
Posts: 624
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is happening because of Constructor Chaining. Every constructor calls its superclass constructor. Take a look at this article: http://www.javabeginner.com/learn-java/java-constructors. You can also Google java constructor chaining. Lastly, Head First Java, Second Edition has what I think is one of the best explanations of constructor chaining I have ever seen
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!