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

generics 1.4

rohit kumar
Greenhorn

Joined: May 27, 2007
Posts: 9

I am getting a runtime error. PLs help
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2341
When you create a List using asList, the size is fixed.
Burkhard Hassel
Ranch Hand

Joined: Aug 25, 2006
Posts: 1274
That's because the list is backed by the array, and arrays can't change their size.

But you could make a copy of the list returned by the asList method using
List ints = new ArrayList(
Arrays.asList(new Integer[] {new Integer(1), new Integer(2), new Integer(3)})
);

Then you'll have your six and ten.


By the way, wouldn't be "The Six and Ten" a nice name for a pub?
Bu.


all events occur in real time
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: generics 1.4
 
Similar Threads
random number generating
boxing,unboxing,for each and varargs
Problem on Generic example from K&B study guide
Pleas help with array
Double and Float