Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java

Chidiebere Ekennia
Chidiebere Ekennia
5,950 Points

I don't know what is wrong with my code, especially the "array":

Here's the code:

import java.io.Console;
import java.util.Random;

public class BranchingStatements {

    public static void main(String[] args) {

      Console console = System.console();
      Array [] Rsvps = {"Eric Bailey", "Warren Buffet", "George Michaels", "Lawrence Sheinfield", "Bruce Willis", "Ryan Gosling"};
      String [] rsvps = Rsvps.shuffled();
      int prizesGivenAway = 0;
      int drawingNumber = 0;

      while (prizesGivenAway < 5) {
      String winner = rsvps [drawingNumber];
      drawingNumber++;
      //console.printf("is %s present?  ", winner);

      String isHere =   console.readLine("is %s present?  ", winner);
      if (isHere.equalsIgnoreCase("no"))
          continue;

         }
       String size = console.readLine("What is your shirt size?  ");
      prizesGivenAway++;

      }



}

Error: BranchingStatements.java:9: error: cannot find symbol
Array [] Rsvps = {"Eric Bailey", "Warren Buffet", "George Michaels", "Lawrence Sheinfield", "Bruce Willis", "Ryan Gosling"};
^
symbol: class Array
location: class BranchingStatements
1 error

Mod Edit: Fixed code formatting - see comment for how to do this yourself!

rydavim
rydavim
18,786 Points

When posting code, there is some markdown you can use to make it more readable. If you wrap your code in three back-ticks you'll get special formatting, and you can optionally add the language for fancy syntax highlighting.

```language

Your code here!

```

// Your code here!