-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
abstract demo: child class inheriteng parent & overriding abstract me…
…thod
- Loading branch information
1 parent
518c282
commit f69d49e
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package Lecture16; | ||
|
||
public class childAbstract extends parentAbstract { | ||
|
||
public int age = 20; | ||
|
||
public void fun1() { | ||
System.out.println("Inside child fun1"); | ||
} | ||
|
||
// overriding parent class fun() as it is defined abstract, you need to | ||
// provide it's implementation | ||
public void fun() { | ||
System.out.println("Inside child fun"); | ||
} | ||
|
||
public void fun3() { | ||
System.out.println("Inside child fun2"); | ||
} | ||
} |