class Person
{
public void show()
{
System.out.println("person");
}
}
/*
class School
{
public void show()
{
System.out.println("school");
}
}
*/
//class Student extends Person,School
class Student extends Person
{
public void method()
{
System.out.println("method");
}
}
class Coder extends Student
{
}
class ExtendsDemo2
{
public static void main(String[] args)
{
Person p = new Person();
p.show();
System.out.println("------");
Student s = new Student();
s.show();
s.method();
System.out.println("------");
Coder c = new Coder();
c.show();
c.method();
}
}
|
|