Forums Register Login

Arrays.asLIit() casting exception (JDK 1.4)

+Pie Number of slices to send: Send
I have



First I want to mention this is not jdk 1.5 or beyond, it is 1.4.
The compilation is OK but gives run time exception of Class Cast for "Arrays.asList()" part. what's wrong and how should I fix it ?

Thanks.
+Pie Number of slices to send: Send
It returns a List, not an ArrayList, no?
+Pie Number of slices to send: Send
asLIit()?
+Pie Number of slices to send: Send
Yeah, it's like asList, but more learned, and in Olde English.

http://shakespearelang.sourceforge.net/report/shakespeare/
+Pie Number of slices to send: Send
David,

i saw your reply and laughed good 10 minutes. :-) Thank you
+Pie Number of slices to send: Send
 

David Newton wrote:It returns a List, not an ArrayList, no?


Actually it does return an ArrayList, just not java.util.ArrayList. The returned class is java.util.Arrays.ArrayList, a private static class inside class java.util.Arrays. But yeah, you're right that as far as the API is concerned, it does return a List.
You guys haven't done this much, have ya? I suggest you study this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1017 times.
Similar Threads
how to copy the objects from set to the list
What is the sequence of persisting for a bidirectional associations?
How to compare ArrayList of objects and get the count?
garbage collection
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 09:21:36.