package polymorph;
class bank
{
public double getinterest(int principle,int time)
{
return 0;
}
}
class HabibMetro extends bank
{
public double getinterest(int principle,int time)
{
return principle* time* 0.1;
}
}
class Alfalah extends bank
{
public double getinterest(int principle,int time)
{
return principle* time* 0.15;
}
}
public class Polymorph
{
public static void main(String[] args)
{
int p=10000,year=2;
double interest;
HabibMetro hb=new HabibMetro();
interest= hb.getinterest(p, year);
System.out.println("Simple Interest from bank habib metro is "+interest);
Alfalah al=new Alfalah();
interest= al.getinterest(p, year);
System.out.println("Simple Interest from bank Alfalah is "+interest);
}
}
Thanks for post:
ReplyDeleteship gửi hàng đi Mali
ship hỏa tiễn tới Tajikistan
chuyển phát cấp tốc sang Samoa