Search Interview Questions
| More than 3000 questions in repository.|
There are more than 900 unanswered questions.
Click here and help us by providing the answer.
Have a video suggestion.
Click Correct / Improve and please let us know.
|Interview Questions and Answers|
|Ans. Generics are a facility of generic programming that were added to the Java programming language in 2004 within J2SE5.0. They allow "a type or method to operate on objects of various types while providing compile-time type safety.|
|Help us improve. Please let us know the company, where you were asked this question :|
|Like Discuss Correct / Improve  generics Asked in 7 Companies|
|What are concepts introduced with Java 5 ?|
| Is this a valid initialization ? Explain.|
Collection<Collection> collection = new LinkedList<LinkedList>();
|Which of the following syntax is correct ?import static java.lang.System.*;or static import java.lang.System.*;|
|Is it legal to initialize List like this ?|
|Which of the following syntax are correct ?a. LinkedList<Integer> l=new LinkedList<int>();b. List<Integer> l=new LinkedList<int>();c. LinkedList<Integer> l=new LinkedList<Integer>();d. List<Integer> l = new LinkedList<Integer>();|
|Which of the following was not introduced with Java 5 ?|
|What are Type Erasures in Java ?|
| In case of generic class declared like following , What can T hold|
|Can we use generics with arrays in Java ?|