Home | | Web Programming | The General Form of a Generic Class

Chapter: Java The Complete Reference : The Java Language : Generics

The General Form of a Generic Class

The generics syntax shown in the preceding examples can be generalized. Here is the syntax for declaring a generic class:

The General Form of a Generic Class

 

The generics syntax shown in the preceding examples can be generalized. Here is the syntax for declaring a generic class:

 

class class-name<type-param-list > { // …

 

Here is the full syntax for declaring a reference to a generic class and instance creation:

 

class-name<type-arg-list > var-name =

 

new class-name<type-arg-list >(cons-arg-list);


Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail
Java The Complete Reference : The Java Language : Generics : The General Form of a Generic Class |


Privacy Policy, Terms and Conditions, DMCA Policy and Compliant

Copyright © 2018-2024 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.