Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
// 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