24.2. Thread Concepts

 
[Page 710 ( continued )]

Review Questions

Sections 21.2 “21.4

21.1 Are there any compilation errors in (a) and (b)?

[Page 711]
21.2 What is wrong in (a)? Is the code in (b) correct?
21.3 What are the benefits of using generic types?
21.4 Can you create an instance using a generic type, for example, new E() or new E[20] ?
21.5 Since you create an instance of ArrayList of strings using new ArrayList<String>() , should the constructor in the ArrayList class be declared as
   public   ArrayList<E>() 

21.6 Can a generic class have multiple generic parameters?
21.7 How do you declare a generic type in a class? How do you declare a generic type in a method?
21.8 What is a bounded generic type?

Sections 21.5 “21.7

21.9 What is a raw type? Is GenericStack the same as GenericStack<Object> ?
21.10 What are an unbounded wildcard, a bounded wildcard, and a lower bounded wildcard?
21.11 If your program uses ArrayList<String> and ArrayList<Date> , does the JVM load both of them?
21.12 Can a method that uses a generic class parameter be static? Why?
 


Introduction to Java Programming-Comprehensive Version
Introduction to Java Programming-Comprehensive Version (6th Edition)
ISBN: B000ONFLUM
EAN: N/A
Year: 2004
Pages: 503

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net