problem!!!

I have written the following code from a book :

class John {

String color;

String sex;

boolean hungry;

void feedJohn() {

if (hungry==true) {

System.out.println("Yum -- a peasant!");

hungry=false;

} else

System.out.println("No, thanks -- already ate.");

}

void showAttributes() {

System.out.println("This is a "+sex+" "+color+" John");

if (hungry==true)

System.out.println("The John is hungry.");

else

System.out.println("The John is full.");

}

}

The error that i am getting is :

Exception in thread "main" java.lang.NoSuchMethodError: main

What is the problem?

I am usin JCreator

[724 byte] By [jonsofa] at [2007-9-27 7:42:39]
# 1
I don't know anything about JCreator, but the error says it all. You apparently tried to execute this class using "java John" but there isn't a main() method in the John class for the JVM to start executing.
atmguya at 2007-7-8 11:53:54 > top of Java-index,Developer Tools,Java Compiler...