package com.oop.demo06;
public class Application2 {
public static void main(String[] args) {
Object object = new Student();
System.out.println(object instanceof Student);
System.out.println(object instanceof Person);
System.out.println(object instanceof Object);
System.out.println(object instanceof Teacher);
System.out.println(object instanceof String);
System.out.println("===============================");
Person person = new Student();
System.out.println(person instanceof Student);
System.out.println(person instanceof Person);
System.out.println(person instanceof Object);
System.out.println(person instanceof Teacher);
System.out.println("===============================");
Student student = new Student();
System.out.println(student instanceof Student);
System.out.println(student instanceof Person);
System.out.println(student instanceof Object);
Person person1 = new Student();
person1.say();
Student student2 = (Student) person1;
student2.study();
((Student)person1).study();
Student student1 = new Student();
Person person2 = student1;
person2.say();
((Student)person2).study();
}
}