package com.BUPt.Test7;
public class DynamicBindingDemo {
public static void main(String[] args) {
}
public static void m(Object x){
System.out.println(x.toString());
}
}
class GraduateStudent extends Student{
}
class Student extends Person{
public String toString()
{
return "Student";
}
}
class Person{
public String toString()
{
return "Person";
}
}
public class DynamicBindingDemo {
public static void main(String[] args) {
}
public static void m(Object x){
System.out.println(x.toString());
}
}
class GraduateStudent extends Student{
}
class Student extends Person{
public String toString()
{
return "Student";
}
}
class Person{
public String toString()
{
return "Person";
}
}