So I'm just starting to learn java and have come to this example:
class Dog {
int size;
String breed;
String name;
void bark() {
System.out.println("Ruff! Ruff!");
}
} // class Dog
class DogTestDrive {
public static void main(String[] args) {
Dog d = new Dog();
d.size = 40;
d.bark();
} // end main
} // class DogTestDrive
When I try to run it I get the following error: Error: Main method not found in class Dog, please define the main method as: public static void main(String[] args)
I don't see where is the problem? This should work with only one main mathod.
DogTestDrive.java DogTestDrive- notjava Dog.