Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dot operator

 
Anand Reng
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks,

In K&B book Chapter-1, page -70 - the two minute drill section says - "Members accessed without the dot operator (.) must belong to the same class.".
At the same time there is an example in page 34, where a protected int x=9 variable in parent class is used in the child class without a dot operator.
I understand this is because of inheritance. then, what am missing with the statement in two-minute drill?

Thanks in Advance for your time folks.

Reagrds,
Anand.
 
Himai Minh
Ranch Hand
Posts: 1328
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think a child class is also a type of its parent class.
A child class belongs to its parent class.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic