Last active
June 17, 2017 06:31
-
-
Save MericBERBER/17ee156969251c64a0ccc81156645cf2 to your computer and use it in GitHub Desktop.
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
// Base Class | |
class Baba | |
{ | |
void show() { System.out.println("Baba'nın metodu."); } | |
} | |
// Inherited class | |
class Cocuk extends Baba | |
{ | |
void show() { System.out.println("Cocuk'un metodu"); } | |
} | |
// Inherited class | |
class Torun extends Cocuk | |
{ | |
void show() { System.out.println("Torun'un metodu); } | |
} | |
// Driver class | |
class Main | |
{ | |
public static void main(String[] args) | |
{ | |
Baba obj1 = new Torun(); | |
obj1.show(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment