• Post Reply Bookmark Topic Watch Topic
  • New Topic

Private members cannot be accessed in derived class  RSS feed

 
shiva kore
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Please correct me if my assumptions was wrong...When we say derived class that means copy of base class plus subclass specific implementations. But when it comes to private members it cannot be accessible in subclass scope. Does it mean byte code generated for subclass doesn't has byte code of private members of super class ?

Thanks,
Shivakumar Kore
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

The bytecode of a class does not include any inherited methods or fields, no matter what their visibility/acessibilily is.
 
shiva kore
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf Dittmer..
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!