0

I am learning Object Oriented Programming but I get the error "Main method not found". Help?

Code:

// Demonstration of Creating and Using Objects and Methods

package cat;



public class Cat {
    
    int size;
    String breed;
    String name;
    
    void meow() {
        System.out.println("Cat: Meow! Meow!");
    }
    
}
class CatTestDrive {
    public static void main(String[] args) {
        Cat c = new Cat();
        
        c.size = 40;
        c.meow();
    }
}

Output:

Error: Main method not found in class cat.Cat, please define the main method as: public static void main(String[] args)

Thanks for the help. And sorry for the weird code. ;)

0 Answers0