This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Non logical code in Ganesh and Sharma book Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Non logical code in Ganesh and Sharma book" Watch "Non logical code in Ganesh and Sharma book" New topic
Author

Non logical code in Ganesh and Sharma book

T . M Badr
Greenhorn

Joined: Mar 05, 2014
Posts: 14
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

Joined: Mar 05, 2014
Posts: 14
Sorry, my mistake, the code is fine.

How can I delete this post?
 
Have you checked out Aspose?
 
subject: Non logical code in Ganesh and Sharma book
 
jQuery in Action, 3rd edition