Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


There is a Banking application. It has 2 types of account,
Savings and Current. Write a method calculateInterest by
passing an ArrayList of these account objects and calculate
Interest accordingly. Write code for this situation



There is a Banking application. It has 2 types of account, Savings and Current. Write a method calc..

Answer / 94374

public class CalculateInterst {
public static double calculateInterest (List list){
double intrest = 0;
if(list != null && list.get(0).equals("SAVING")){
//Calculate interest for Saving Account and return it
intrest = 7.0;

}else if (list != null && list.get(1).equals("CURRENT")){
//Calculate interest for Saving Account and return it
intrest = 5.0;
}
return intrest;
}

public static void main(String[] args) {
List list = new ArrayList();
list.add("SAVING");
list.add("CURRENT");
calculateInterest(list);
}

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More Core Java Interview Questions

What are decalarations?

0 Answers  


What is a class in java?

0 Answers  


What is Unicast and Multicast object? Where we will use?

1 Answers   Scope International,


can any body tell me? does advance java and j2ee both are same.

4 Answers   CTS, Infosys,


when a servlet sends request for first time it uses the follwing methods a)init b)doget() c)dopost() d)service

4 Answers   Accenture,


What is the difference between conversation & casting?

0 Answers  


Who is the owner of java?

0 Answers  


What is Collection interface?

1 Answers   Zensar,


How do you reverse a string in java without using string buffer?

0 Answers  


Why Set interface contains unique elements, what internally implemented for this so that it contains unique elements?

1 Answers   Rolta, TCS,


How applets will communicate with each other?

1 Answers  


What is thread life cycle?

0 Answers  


Categories