Java, Programming, Object Oriented Design, Objectorientedprogramming, Oop.
void makeSound() { System.out.println(name + " says: Woof Woof!"); } @Override public void sleep() { System.out.println(name + " is sleeping."); } } public class Main { public static void main(String[] args) { Dog dog = new Dog("Buddy"); dog.makeSound(); // Output: Buddy says: Woof Woof!