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 Java Objects (Retired) Meet Objects Creating New Objects

why the cannot find symbol error occurs ?

tried many times to find what im missing without success.. anyone please?

Example.java
public class Example {

    public static void main(String[] args) {
        System.out.println("We are going to create a GoKart");
      GoKart newType = new GoKart("red");
      System.out.printf("the new GoKart color is %s", newType.getColor);



    }
}

1 Answer

Chase Marchione
Chase Marchione
155,055 Points

Hi Tal,

What's missing are the parentheses needed to call the getColor method. Otherwise, the compiler thinks that getColor is a variable, and it cannot find it, as a getColor variable does not exist for newType (it's the getColor method that does.)

      System.out.printf("the new GoKart color is %s", newType.getColor());

Hope this helps!

Great! thanks!