• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help understanding exception

 
Bill Parsh
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Google didn't help much , so I'm trying you guys.

Error - java.lang.ClassCastException: [C cannot be cast to java.lang.Double

What does [C mean?

My application interfaces with a 3rd party application which causes the exception to be shown in a pop up window, so I don't get a full trace in Netbeans. This exception is also hard for my to duplicate, making it even harder for me to diagose.
 
Rob Spoor
Sheriff
Pie
Posts: 20494
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If a class name starts with [ that means it is an array. As for C, that's one of the reserved names for the primitive types. See http://dev.kanngard.net/Permalinks/ID_20050509144235.html for a more extensive list.

In this case, [C means char[].
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"[C" is "array of char." The notation is called a "field descriptor", and it's the closest thing an array class has to a class name. See the Java Virtual Machine Specification.

[ Edit: Darn, Rob beat me to the punch. ]
 
Henry Wong
author
Marshal
Pie
Posts: 20882
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does [C mean?


In Java type speak, "[" means array of, and "C" means a primative char type. So, "[C" means an array of chars... ie.... something like....

char [] cvar = new char[10];

Henry
 
Bill Parsh
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm also getting exception: access violation 0xc0000005 in this and other code that has never given me a problem before. Also, sometimes I'll just be typing in Netbeans and suddenly it will disappear and I'll be looking at my empty desktop, no error messages, no pop up. I've tried updating and reinstalling the JDK and Netbeans but that hasn't helped. I'm planning to reformat this weekend.

I'm having a real hard time understanding how my code could be causing the [C exception, is it possible that whatever is causing the access violation is somehow causing this too?
 
Bill Parsh
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I ended up having a bad stick of RAM. I took it out and the [C exceptions and the access violations seem to be gone.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic