• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Inheritance

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the question is :
All the members of a class are inherited in a subclass (T/F) ?
Confusion is :
- Constructors are not inherited.(but JLS says they are not
considered as members)
- Private members are not inherited, but they do exist in the
sub-classes. But some mocks exam says that Private members are
inherited but you cannot access .
Private members are inherited by subclass or not ? What is the
answer of the above question ?
 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi mohan,
I would select this..
all the members of the super classare inherited by the subclass but the constructors and private members cannot be accessed
kindly correct me if Iam wrong.
subbu
(subs197)

[This message has been edited by Subramaniam Venkatesan (edited February 26, 2001).]
 
Ishaan Mohan
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Subramaniam,
Constructors are not inherited by superclass, there is no confusion for this as acc to JLS they are not considered as members and not inherited by subclasses. Confusion is with Private members.
 
Subramaniam Venkatesan
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi..
thanks for it. I had a big doubt about it with your
question.. I will correct my prev. statement
but I have read that(may be here in these forums) private methods get inherited by the sub class but can't be accessed
 
Subramaniam Venkatesan
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey.. I dint know there are two threads on the same one..
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic