what is generics in jdk1.5?

Answer Posted / rohitjadhav

Hi,

Generics is Template support added in JDK1.5 where in we can maintain templates of object with particular type and also this object is restricted to accept type other than specified one at code time.
This help reducing runtime exception and also we can create predefined well formed templates of Type.

Best Example.

http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html#generics

Code written to use the generics feature should not be a lot slower or a lot more memory-intensive than non-generic code. Using ten percent more space or time than ....

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a protected method?

591


What do you mean by inner class in java? Explain

582


why java uses class level type casting ?

2251


What do you understand by the term polymorphism?

625


If a variable is declared as private, where may the variable be accessed?

546






What does += mean in java?

570


What is a double vs float?

532


What is data member in java?

499


What are the 4 versions of java?

553


4.1 Supply contracts (in the form of comments specifying pre- and post conditions) for the enqueue() method of the LinkedQueue class given in the Appendix. (2) 4.2 Let Thing be a class which is capable of cloning objects, and consider the code fragment: Thing thing1 = new Thing(); //(1) Thing thing2 = thing1; //(2) Thing thing3 = (Thing) thing1.clone(); //(3) Explain how the objects thing2 and thing3 differ from each other after execution of the statements. (

1406


what methods would you overwrite in java.lang.object class?

560


What is a literal coding?

510


Is set thread safe java?

499


Why for each loop is used?

500


define polymorphism in java

628