• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Access modifier to an Abstract Class constructor

 
Reshma Shanbhag
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whats the answer to following question.
Question :
Which of the following access modifiers can be supplied for the constructor of an abstract class ?
Options :
a . public
b . protected
c . private
d . default
e . friendly
f . No access modifier
 
Karthik Veeramani
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using public, private, protected, or default access doesnt generate compile error. If u extend that abstract class (or do something that invokes super class constructor), it gives a compile error if the constructor is not reachable (for example, if its private it gives an error).
Thanks
Karthik.
 
Reshma Shanbhag
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for you help Karthik.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic