This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes access modifier and constructors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "access modifier and constructors" Watch "access modifier and constructors" New topic
Author

access modifier and constructors

Alpana Singh
Ranch Hand

Joined: Sep 27, 2005
Posts: 36
This is the question fron jdiscuss.com mock exam.

You can only call public and protected constructors of the super class in a subclass if the subclass is not in the same package because only those are inherited.


I answered true,but the answer is false.

Somebody plz give me the reason behind this
Sandeep Chhabra
Ranch Hand

Joined: Aug 28, 2005
Posts: 340
Hi,

You can only call public and protected constructors of the super class in a subclass if the subclass is not in the same package because only those are inherited.


I think constructors are not inherited.


Regards<br />Sandy<br />[SCJP 5.0 - 75%]<br />[SCWCD 1.4 - 85%]<br />------------------<br />Tiger, Tiger burning bright,<br />Like a geek who works all night,<br />What new-fangled bit or byte,<br />Could ease the hacker's weary plight?
Mandy Hou
Greenhorn

Joined: Oct 15, 2005
Posts: 21
constructors can not inherited.


Regards<br />Mandy<br /> <br />-----------------<br />Thinking,Thinking,Thinking,<br />Before you do any action!!!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: access modifier and constructors
 
Similar Threads
what is the alternative to Singleton????
Java enums, space, and display values
Diffrence b/w constructor and method Breiefly
JQ+: Constructors and access
Overriding and Exception