what is generics in jdk1.5?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / 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 |
what is mean by String and StringBuffer? What is mean by Methooverriding and Overloading?
How to avoid the runtime exception ?
What is the purpose of void?
How is it possible in java programming for two string objects with identical values not to be equal under the == operator?
Howmany classes that package java.applet.* contains?
Can we have more than one package statement in the source file?
What does this () mean in constructor chaining concept?
What programs use java?
what r advatages of websphere? & how to deploy?
Difference between JVM and JRE?
what questions are been asked ??? for interview in apti
What is the method used to get the absolute value of a number?