Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Mammal {
- public void breathe() {
- System.out.println("Inhale and exhale");
- }
- }
- public class Cat extends Mammal {
- public void speak() {
- System.out.println("Meow!");
- }
- }
- public class Exec {
- public static void main(String[] args) {
- Cat rani = new Cat();
- rani.breath();
- rani.speak();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement