• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

does class inherits the constructors of super class

 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does a class inherit the constructors of its superclass?


 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As long as it is not private, I'd say that it does.
 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Satou kurinosuke:
As long as it is not private, I'd say that it does.


Originally posted by Satou kurinosuke:
As long as it is not private, I'd say that it does.


areyou really sure about it?
then why can't you give me a sample program to simulate this concept
:-)

thanks in advance
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Forget the crap I've posted above
I'll check what I'm saying with samples when I'm not 100% sure.

Constructor declarations are not members. They are never inherited and therefore are not subject to hiding or overriding.
[ September 04, 2006: Message edited by: Satou kurinosuke ]
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15482
43
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, constructors are not inherited. For example, if you create a class that has a constructor that takes a String, and then you create a subclass of that class, the subclass does not automatically have a constructor that takes a String.

[ September 04, 2006: Message edited by: Jesper Young ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic