1 2 3 4 5 6 7 8 9 10 11 12
public class App { public static void main(String[] args) { Person p1 = new Person("Kamal"); System.out.println(p1.toString()); Student s1 = new Student("Tharindu", "ST003"); System.out.println(s1.toString()); Person p2 = new Student("Yasas", "ST002"); System.out.println(p2.toString()); } }