Is it legal to initialize List like this ?<br/><br/><br/>LinkedList<Integer> l=new LinkedList<int>();
Javasearch.buggybread.com
Share

Search Interview Questions


 3358 questions in repository.
 There are more than 200 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Java - Interview Questions and Answers

 Q1. Is it legal to initialize List like this ?


LinkedList l=new LinkedList();
Admin
info@buggybread.com
Ans. No, Generic parameters cannot be primitives.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   collections   list   linkedlist   generics   yes-no


Related Questions

 Is this a valid initialization ? Explain.

Collection<Collection> collection = new LinkedList<LinkedList>();
  What are concepts introduced with Java 5 ?
  Which of the following syntax is correct ?
  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 ?
 Explain Generics in Java ?
 In case of generic class declared like following , What can T hold

class MyClass<T>{
T element;
}
 Can we use generics with arrays in Java ?




Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus
 

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked:
         

X Close this