Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

doubt in inheritance

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
the statement: "All the members of the superclass are inherited by the subclass" is true.
the above statement is read from Mughal book. i think it is false, because private members are not inherited by the subclass right? can anybody help me out.
thanks in advance
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The issue here is one of semantics. The quoted statement you give seems to imply that inheritance and accessibility are close to the same thing.
If a parent class has some private members, those private members are still part of the subclass' overall makeup -- the subclass cannot access them directly, but that's another matter.
So:
All the members of the superclass are inherited by the subclass --> if I'm a language lawyer, I say true. If I'm trying to understand the meaning of the question, I guess: true?
All the members of the superclass are accessible by the subclass: definitely not true for all cases, therefore false.
Hope this helps,
[This message has been edited by Michael Ernest (edited December 01, 2000).]
 
I am a man of mystery. Mostly because of this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic