| Share this post! | Vote this! |
|
This article contains details of Generics in Java. The Generics
permits us to develop classes and objects that can work on any defined
types.
In general words, Generics allows us to create a single method for sorting that can be used to sort Integer array, a String array or any type that supports ordering. Similarly, a generic class allows us to use this class for any defined types.
Generics permits us to catch the incompatible types during compilation. The main reason of using Generics code is to assures type safety. It means that types which are required for Application and the types which is sent by the client, must match. If there is difference or match is incompatible then it will leads to error. To ensure this match or compatibility we use Generics. more...
Java Generics
The Generics permits us to develop classes and objects that can work on any defined types.In general words, Generics allows us to create a single method for sorting that can be used to sort Integer array, a String array or any type that supports ordering. Similarly, a generic class allows us to use this class for any defined types.
Generics permits us to catch the incompatible types during compilation. The main reason of using Generics code is to assures type safety. It means that types which are required for Application and the types which is sent by the client, must match. If there is difference or match is incompatible then it will leads to error. To ensure this match or compatibility we use Generics. more...



0 comments:
Post a Comment