Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Arrays

Cynthia McGillis
Cynthia McGillis
585 Points

JacksonsOldSchool.java:15: error: class, interface, or enum expected

I'm following along Craig's Array video in the Feeling Loopy series. I am getting two errors (and yes, I have Googled them) but for the life of me I can't figure out what is wrong. I'm copying his code directly and I also don't think I am missing any curly braces.

import java.io.Console;

public class JacksonsOldSchool {

    public static void main(String[] args) {
        Console console = System.console();
      String[] jacksons = {"Michael", "Jackie", "Tito"
                      "Jermaine", "Marlon", "Randy"};

     console.printf("The Jackson 5 are: %n");

      for (int i = 0; i < jacksons.length; i++) {
      String jackson = jacksons[i];
      console.printf("%s Jackson %n", jackson); 
      }
    }
}

1 Answer

Cynthia McGillis
Cynthia McGillis
585 Points

Answered my own question! I was missing a comma after "Tito."

However, still confused that my error messages were pointing me in the wrong direction. Oh well.

Changed to an answer - Dane E. Parchment Jr. (Moderator)