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!

Array with char. values, problem?

807599Nov 29 2006 — edited Dec 2 2008
Hi, i am trying to make an static final array which holds the key for answer on a test. the answers are all letters. so i am trying to make an array but i get an error when i try to compile saying "] expected" and it highlights the last line where i try assigning the char 'B' to the first box of the array. any comments or suggestions ? thanks.
public class DriverExam
{
    public final int KEYNUM = 20;
    public final char[] KEY = new char[KEYNUM];
    
    KEY [0] = 'B';
    

} // end class DriverExam
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 30 2008
Added on Nov 29 2006
88 comments
536 views