I'm trying to create a string array, but the compiler keeps giving me an error message on the lines I assign a value to each index of the array. Here's the code:
String[] greeting = new String[4];
greeting[0] = "Why, Hello there!";
greeting[1] = "Welcome.";
greeting[2] = "blah blah blah";
greeting[3] = "more useless crap";
The error messages I get are: ']' expected, ';' expected, illegal start of type, and <identifier> expected. I know creating an array is pretty basic, but I can't figure out what I'm doing wrong. Any help would be appreciated.