A Name Data Class

Often in books, we see programs that learn us how to do things like calculate and draw and other action-verb-oriented things. In business, however, we often need to also represent things. Object-oriented programming has as one of its tenets that an object contains data and behavior. Sometimes, however, this behavior is either fairly limited, or is implemented fully in increasing usability. Take, for example, a simple thing like a person's name.

Many applications need to represent names, but they often are implemented poorly. On the one hand, a complete name gets represented as a single String. This makes it almost impossible to deal with in searches, comparisons. Other times, names are only slightly more conscientiously dealt ...

Get Java Garage now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.