I am studying run time polymorphism, I find one example like this
class Bike {
void run() {
System.out.println("running");
}
}
class Splender extends Bike {
void run(){
System.out.println("running safely with 60km");
}
public static void main(String args[]){
Bike b = new Splender (); //upcasting
b.run();
}
}
here Bike class object b can access method run of Splender its okay, so can we access run() method of Bike? if yes then how? if not then why?