Ploymorphism(Upcase Downcase):
eg:
class Father{
public void say(){
System.out.println("father");
}
}
public class Son extends Father{
public void say(){
System.out.println("Son");
}
public void say1(){
System.out.println("Son1");
}
public static void main(String args[]){
Father s = new Son(); // Ploymorphism(Upcase)
s.say();
// error s.say1();
if(s instanceof Son){
Son s1 = (Son)s; // Downcase
//s1.say()
s1.say1();
}
}
}
(instanceof ) this keyword like =><,return a boolean,compare left and right object is or isn't a same Object.(like Equals)