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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.