Why does the following program from page 36 compile but not run? It sets the message: Exception in
thread "main" java.lang. NoSuchMethodError:main.
code
--------------------------------------------------------------------------- class Dog {
int size ;
String breed ;
String name;
public void bark() {
System.out.println ("Ruff! Ruff!");
}
}
class DogTestDrive {
public static void main(String[] args) {
Dog d = new Dog() ;
d.size = 40;
d.bark();
}
}
------------------------------------------------------------------------
If I remove the class DogTestDrive line and appropriate braces it then runs but that seems to be defeating the intent of the lesson.