abstract class Bike{
abstract void run();
}
class Honda extends Bike{
void run(){
System.out.print("running");
}
public static void main(String args[]){
Bike obj=new Honda(); //Upcasting
obj.run();
}
}
We could have get the same result using
Honda obj=new Honda();
obj.run();
why use upcasting? If we can get the same results?