what is generics in jdk1.5?

Answer Posted / tarun

Please go through this link for more knowledge
http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf

Generics is the new feture added in the JAVA5.0. It feature
is useful in some broad applications when we are writing any
database insertion logic for the same type of Object.
suppose we have to insert a list of Employee Object this
will be declared as List<Employee> or suppose we have a list
of long values then we can simply type cast it as
List<Long>, Similarly List<String>, List<Integer>. The
generics class are used by Wrapper classes or any other
classes. Most useful in ORM technologies also.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is hashset ordered?

547


What are the states of thread in java?

509


Why parameters should be passed by reference?

498


What is the benefit of abstract class?

513


What is a flag variable?

557






What are the 7 types of characters?

564


Why do we declare a class static?

541


How many bytes is a string java?

526


What are the methods available in a class?

585


how to write a program for sending mails between client and server

1550


Can we have two main methods in a java class?

534


How is abstraction implemented in java ?

539


What are the four pillars of java?

608


Explain the use of volatile field modifier?

631


How do you achieve polymorphism in java?

519