November 2012
Beginner
336 pages
8h 17m
English
Now that we’ve discussed limiting access to fields and methods in Java, we can turn our attention more generally to communicating through methods. Programmers who write Java classes for others to reuse want to design methods that indicate their purpose. Programmers who write packages of classes may write methods to indicate how one object type applies to others in the same package. And some class-private methods may even take the appearance of a class talking to itself.
In method design, every aspect of the method’s signature counts: Its access modifier, return type, name, and parameters all communicate some aspect of the method’s utility. Thoughtful design will pay for itself again and again.
In this ...
Read now
Unlock full access