38.3. Template (Parameterized, Generic) Class

Template classes and their instantation are shown in Figure 38.6.

Figure 38.6. Template classes.

Some languages, such as C++, support templatized, generic, or parameterized classes. In addition, this feature will be added to the Java language. For example, in C++, map<string, Person> declares the instantiation of a template class with keys of type string, and values of type Person.

Get Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and the Unified Process, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.