Unverified Commit e3738322 authored by Lokesh Singh's avatar Lokesh Singh Committed by GitHub

Create abstract.java

parent 4a0c661a
abstract class Animal {
abstract void makeSound();
public void eat() {
System.out.println("I can eat.");
}
}
class Dog extends Animal {
public void makeSound() {
System.out.println("Bark bark");
}
}
class Abstract {
public static void main(String[] args) {
Dog d1 = new Dog();
d1.makeSound();
d1.eat();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment