Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

char set to null?

807600Nov 24 2007 — edited Nov 24 2007
So, I have no experience with using null, but the code I am working on requires char to be set to null, specifically values in a char array.

According to the book I'm using, "null is a special constant that can be used to give a value to any variable of any class type". However, when I try to set an item in the char array to null, the compiler returns

Error: incompatible types
found : <nulltype>
required: char

So, I'm wondering if this is possible at all. Or how to do it exactly.

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 22 2007
Added on Nov 24 2007
1 comment
421 views