0

Java error- java:12: class, interface, or enum expected?


class ProgrammingProject01
{
public static void main(String blabla[])
{
System.out.println("Hello");
World world1 = new World();
Turtle turtle1 = new Turtle(world1);
}
}


public void drawN1()
{
this.penUp();
this.moveTo(50,50);
this.penDown();
this.setPenWidth(5);
this.setColor(new java.awt.Color(255, 0, 0));
this.turn(180);
this.forward(50);
this.turn(180);
this.forward(50);
this.setColor(new java.awt.Color(255, 200, 0));
this.turn(135);
this.forward(70);
this.setColor(new java.awt.Color(255, 255, 0));
this.turn(225);
this.forward(52);
}


its saying theres an error with the line starting with public void to the end and i don't understand why

2
Contributors
1
Reply
3
Views
5 Years
Discussion Span
Last Post by stultuske
1

class ProgrammingProject01
{
public static void main(String blabla[])
{
System.out.println("Hello");
World world1 = new World();
Turtle turtle1 = new Turtle(world1);
}
}

that bracket closes your class. remove it, and put one after your drawN1() method.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.