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

Non logical code in Ganesh and Sharma book

 
T . M Badr
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is quoted from Ganesh and Sharma book page 89:


Now let's discuss another scenario where a common functionality needs to be supported by all the shape objects.
For instance, each object could be drawn inside another shape object, which means each shape object has a parent
(i.e., containing) object. As pointed out earlier, abstract classes are the best place to put a common functionality.



But how child classes can use the getter and setter of the parentShape, parentShape is defined as private in the base class, which makes it not accessible by other classes.
 
T . M Badr
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, my mistake, the code is fine.

How can I delete this post?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic