public class Bank
{
public static int getRateOfInterest()
{
return 5;
}
}
Hdfc.java public class Hdfc extends Bank
{
/*
* static method cannot be overridden, because static method is bound with
* class whereas instance method is bound with object. Static belongs to
* class area and instance belongs to heap area.
*/
public static int getRateOfInterest()
{
return 10;
}
}
Icici.java public class Icici extends Bank
{
/*
* static method cannot be overridden, because static method is bound with
* class whereas instance method is bound with object. Static belongs to
* class area and instance belongs to heap area.
*/
public static int getRateOfInterest()
{
return 8;
}
}