My current assignment in a beginning Java course is to animate a circle across the window. The problem I am having is that no matter what I put when I want to create a circle or rectangle, or anything like that, I always get
java.lang.NoSuchMethodError: main
Exception in thread "main"
After Googling, I always find that the answer is that I am missing the ‘public static void main’ code, but I have it included every single time. Even simple code such as this (which sinec I have yet to see how rectangles or circles actually would appear I’m assuming this code should be correct):
public class Chapter6_Hw4
{
public static void main(String[] args)
{
Rectangle r = new Rectangle(50, 50, 100, 100);
System.out.println( "You have created a rectangle" );
}
}
Hope I can get some help on this from you guys. I’m assuming this is just some really noobie issue I’m overlooking. Thanks!
Be sure that you’re compiling and running
Chapter6_Hw4.java, notRectangle.java.