The Codeless Code: Case 3 - Encapsulation
Join the DZone community and get the full member experience.Join For Free
a young monk, new to the temple, not only declared all his methods public but all his instance variables as well. the head abbot grew weary of rebuking the monk and asked the java master for advice.
the next day, the master summoned the monk to take lunch with him in his private office.
the monk entered to find a sumptuous meal laid out upon the conference table. the master then bade the monk to lie upon the floor.
the monk did as commanded, whereupon the master opened the monk’s robes and drew a large knife. he pressed the naked point firmly into the monk’s chest until a ruby droplet welled up around the blade. the monk cried out in terror and asked the master what his intention was.
“to slit open your belly,” explained the master, “so that i may spoon the rice and pour the tea inside. my schedule is quite full, and i find this method of feeding guests to be extremely efficient.”
afterward the monk required no more correction.
Published at DZone with permission of Qi The Scribe, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.