aspose file tools*
The moose likes Java in General and the fly likes does class inherits the constructors of super class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "does class inherits the constructors of super class" Watch "does class inherits the constructors of super class" New topic
Author

does class inherits the constructors of super class

saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
Does a class inherit the constructors of its superclass?




A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

As long as it is not private, I'd say that it does.


[My Blog]
All roads lead to JavaRanch
saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
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

Joined: Nov 24, 2005
Posts: 14687
    
  16

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

Joined: Aug 16, 2005
Posts: 14150
    
  18

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 ]

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: does class inherits the constructors of super class