Submitted by: Submitted by rahul1211
Views: 112
Words: 1669
Pages: 7
Category: Other Topics
Date Submitted: 09/22/2013 03:11 AM
what is generics in jdk1.5? | |
|Answer |Hi, | |
|# 1 | | |
| |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 .... | |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Ex01 {
public static void main(String[] args) throws IOException {
BufferedReader userInput = new BufferedReader
(new InputStreamReader(System.in));
ArrayList myArr = new...