aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Arrays of generics Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Arrays of generics" Watch "Arrays of generics" New topic
Author

Arrays of generics

Alina Petra
Greenhorn

Joined: Oct 17, 2006
Posts: 26
Which of the following lines can be compiled?

a)Basket<Apple>[] b = new Basket<Apple>[10];

b)Basket<?>[] b = new Basket<Apple>[10];

c)Basket<?>[] b = new Basket<?>[10];

d)public <T> T[] test() {return null;}

e)public <T> T[] test() {return new T[10];}

Can anyone give the right answer followed by explanation?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Arrays of generics