Bank of America Interview Question for Java Developers
- -1of 1 vote
Create a CostDomainObject named as CostDTO (like Data transfer object or value object) with- Sameer July 10, 2017 in United States
three attributes, costId as type String and costAmout as type BigDecimal, effectiveDate as Date.
Override equals and hashcode methods based on costId.
Create Interface CostCalculator taking above CostDTO object as 2 Arguments
1) CostDTO add(CostDTO arg1, CostDTO arg2);
2) CostDTO subtract(CostDTO arg1, CostDTO arg2);
Implement the above 2 methods. You are creating those methods to sum up or subtract cost
amounts based on costId.
Throw a checked exception when the costIds are not the same.
Mostly what I am looking for is how you test your code. This is important as you will be
re-factoring/rewriting existing code or going to enhance existing functionality. We try to do test
| Report Duplicate | Flag | PURGE
Bank of America Java Developer
Open Chat in New Window