Skip to content

Instantly share code, notes, and snippets.

@MericBERBER
Last active June 17, 2017 06:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MericBERBER/17ee156969251c64a0ccc81156645cf2 to your computer and use it in GitHub Desktop.
Save MericBERBER/17ee156969251c64a0ccc81156645cf2 to your computer and use it in GitHub Desktop.
// 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