



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Department of Computer ScienceUniversity of Maryland, College Park
Generic Programming Generic Classes
You can define your own generic classes^ Define a class and follow the class namewith the type variable(s) in angle brackets.^ Use the type variable to define the type ofvariables, type of method arguments, returntype of a method, or in object allocation You can use any name for the type variable butusually uppercase short names (E, K) are used. Example: see Queue.java in code distribution