Untitled

mail@pastecode.io avatar
unknown
java
2 years ago
474 B
3
Indexable
Never
package com.company;

import java.util.*;


class Parent {

    void show(){
        System.out.println("This Is parent Class\n");
    }
}
class Child extends Parent{
    void show_2(){
        System.out.println("This is child class\n");
    }
}

class Main {
    public static void main(String[] args) {
        Parent obj= new Parent();
        Child obj2 = new Child();

        obj.show();
        obj2.show_2();
        obj2.show();

    }
}