Techhgeekz ™

Monday 30 December 2013

Generics in Java ..!

Generics :-

Enable types (classes and interfaces) to be parameters when defining classes, interfaces and methods. Much like the more familiar formal parameters used in method declarations, type parameters provide a way for you to re-use the same code with different inputs. The difference is that the inputs to formal parameters are values, while the inputs to type parameters are types.

Hope this Quote would resolve yur  Fuzzy about Generics ..! ;) 

Code that uses generics has many benefits over non-generic code:

Stronger type checks at compile time.

A Java compiler applies strong type checking to generic code and issues errors if the code violates type safety.

 Fixing compile-time errors is easier than fixing runtime errors, which can be difficult to find.

For in Depth about Generics visit :-

No comments:

Post a Comment