Created
November 23, 2017 08:02
-
-
Save hadifar/ac2560209d4d2e155882d3753acd5eb2 to your computer and use it in GitHub Desktop.
abstract and interface
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
| class Example1{ | |
| public void display1(){ | |
| System.out.println("display1 method"); | |
| } | |
| } | |
| abstract class Example2{ | |
| public void display2(){ | |
| System.out.println("display2 method"); | |
| } | |
| } | |
| abstract class Example3 extends Example1{ | |
| abstract void display3(); | |
| } | |
| class Example4 extends Example3{ | |
| public void display3(){ | |
| System.out.println("display3 method"); | |
| } | |
| } | |
| class Demo{ | |
| public static void main(String args[]){ | |
| Example4 obj=new Example4(); | |
| obj.display3(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment