Last active
August 22, 2021 17:01
-
-
Save Mahdi-Hasan/0374280653144e87422b25f1aa7a6834 to your computer and use it in GitHub Desktop.
This is a question of Multilevel Inheritance....What will be the output & Explain your answer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public A{ | |
| public void print(){ | |
| System.out.println("Inside A"); | |
| } | |
| } | |
| class B extends A{ | |
| public void print(){ | |
| System.out.println("Inside B"); | |
| } | |
| } | |
| class C extends B{ | |
| } | |
| class Test{ | |
| public static void main(String[] args) { | |
| C c = new C(); | |
| c.print(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment