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 string is a data type?

572


What is the size of int in 64-bit jvm?

557


Can anonymous class have constructor?

552


Given a singly linked list, find the middle of the list in a single traversal without using temporary variable.

617


What is the purpose of declaring a variable as final?

490






What is purpose of find feature?

616


there are N number of matchboxes numbered 1...N.each matchbox contain various number of stick.Two player can alternatevely pick some amount of stick from the higest stick containing box . The player is condidered win if there is no stick after his move.Find the final move so that the move player win. Note:In case the number of stick is equal ,pick the stick from the higest numbered box.

1578


What do you understand by soft reference?

588


Explain the difference between transient and volatile in java?

582


how to create multithreaded program? Explain different ways of using thread? When a thread is created and started, what is its initial state? : Java thread

537


What is meant by stack and queue?

608


What is immutable in java?

550


What is cr keyboard?

659


Can vector have duplicates in java?

511


What happens if an exception is not handled in a program?

630