Generic Classes
}The concept of a data structure, such asa stack, can be understood independently of the element type it manipulates.
}Generic classes provide a means for describing the concept of a stack (or any other class) in a type-independent manner.
}These classes are known as parameterized classes or parameterized types because they accept one or more type parameters.
Raw Types
}It’salso possible to instantiate generic class Stack without specifying a type argument, as follows:
// no type-argument specified
Stack objectStack = new Stack( 5 );
◦objectStack is said to have a raw type
◦The compiler implicitly uses type Object throughout the generic class for each type argument.
◦The preceding statement creates a Stack that can store objects of any type.
◦Important for backward compatibility with prior versions of Java.
◦Raw-type operations are unsafe and could lead to exceptions.
.

