abstract class Bank{
abstract int getRateOfInterest();
}
class SBI extends Bank{
int getRateOfInterest(){return 7;}
}
class PNB extends Bank{
int getRateOfInterest(){return 8;}
}
class TestBank{
public static void main(String args[]){
Bank b;
b=new SBI();
System.out.println("Rate of Interest is: "+b.getRateOfInterest()+" %");
b=new PNB();
System.out.println("Rate of Interest is: "+b.getRateOfInterest()+" %");
}
}
So what I read in the books and online is: "Abstraction is a process of hiding the implementation details and showing only functionality to the user."
So my question is, If I write implementation in Bank class, will it not be hidden?, can user see that implementation?
What is the actual mean of 'hiding' here?