Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

access modifier and constructors

 
Alpana Singh
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 340
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mandy Hou
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
constructors can not inherited.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic