aspose file tools
The moose likes Beginning Java and the fly likes Arrays.asLIit() casting exception (JDK 1.4) Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Arrays.asLIit() casting exception (JDK 1.4)" Watch "Arrays.asLIit() casting exception (JDK 1.4)" New topic
Author

Arrays.asLIit() casting exception (JDK 1.4)

FY Hsieh
Ranch Hand

Joined: Aug 07, 2006
Posts: 73
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.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

It returns a List, not an ArrayList, no?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56151
    
  13

asLIit()?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Yeah, it's like asList, but more learned, and in Olde English.

http://shakespearelang.sourceforge.net/report/shakespeare/
Steve Fahlbusch
Ranch Hand

Joined: Sep 18, 2000
Posts: 491
    
    2

David,

i saw your reply and laughed good 10 minutes. :-) Thank you
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

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.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Arrays.asLIit() casting exception (JDK 1.4)
 
Similar Threads
What is the sequence of persisting for a bidirectional associations?
How to compare ArrayList of objects and get the count?
garbage collection
how to copy the objects from set to the list