Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class A {
- void show() {
- System.out.println("Base Class");
- }
- }
- class B extends A {
- @Override
- void show() {
- System.out.println("Derived Class");
- }
- }
- class Pr2a {
- public static void main(String args[]) {
- A obj = new A();
- obj.show();
- B obj1 = new B();
- obj1.show();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement