Java, Programming, Object Oriented Design, Objectorientedprogramming, Oop.
Animal(String name) { this.name = name; } public String getName() { return name; } // Abstract method public abstract void makeSound(); // Concrete method public void sleep() { System.out.println(name + " is sleeping."); } } class Dog extends Animal { public Dog(String name) { super(name); }