Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

What are Generics in Java

In Common term Generic means a common type of things or relating to a class or group of things not specific.

In Java Generics are introduced in 2004 within Java 5.0 features along with Enum, autoboxing and varargs , to provide compile time type-safety.Java Generic methods and generic classes enable programmers to specify, with a single method declaration, a set of related methods or, with a single class declaration, a set of related types, respectively.
What is type-safety?
It is just a check by compiler that correct Type(datatype) is used in correct place and there should not be any ClassCastException.
Read more »
©JavabynataraJ is a blog with java tutorials and Real time tips.


This post first appeared on JAVAbyNATARAJ, please read the originial post: here

Share the post

What are Generics in Java

×

Subscribe to Javabynataraj

Get updates delivered right to your inbox!

Thank you for your subscription

×