• Post Reply Bookmark Topic Watch Topic
  • New Topic

subclasses  RSS feed

 
enombe thierry
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do subclasses inherit their superclass constructor and how?plseae i have a misunderstanding somewhere
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
enombe thierry wrote:do subclasses inherit their superclass constructor and how?


No, constructors are not inherited.
 
Supun Lakshan Dissanayake
Ranch Hand
Posts: 143
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
enombe thierry wrote:do subclasses inherit their superclass constructor and how?

NOPE.
consider following example.
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Supun Lakshan Dissanayake wrote:
enombe thierry wrote:do subclasses inherit their superclass constructor and how?

NOPE.
consider following example.


That doesn't tell us anything about whether they're inherited or not.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!