is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
package com.sa.dtoTest;
- aditya July 12, 2017import java.math.BigDecimal;
import java.math.MathContext;
public class caluculator implements CostCaluculator{
@Override
public CostDTO add(CostDTO arg1, CostDTO arg2) {
BigDecimal bD;
if(arg1.equals(arg2)){
MathContext mc = new MathContext(4);
bD = arg1.costAmount.add(arg2.costAmount,mc);
System.out.println(bD);
return arg1;
}else{
try {
throw new IdnotMatchException("Not equals");
} catch (IdnotMatchException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return null;
}
@Override
public CostDTO subtract(CostDTO arg1, CostDTO arg2) {
BigDecimal bD;
if(arg1.costid==arg2.costid){
MathContext mc = new MathContext(4);
bD = arg1.costAmount.subtract(arg2.costAmount,mc);
System.out.println(bD);
return arg1;
}else{
try {
throw new IdnotMatchException("Not equals");
} catch (IdnotMatchException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return null;
}
}
//costDTo.java
package com.sa.dtoTest;
import java.math.BigDecimal;
import javapractice.date;
public class CostDTO {
String costid;
BigDecimal costAmount;
date effectiveDate;
public CostDTO(String costid,BigDecimal costAmount, date effectiveDate) {
this.costid=costid;
this.costAmount=costAmount;
this.effectiveDate=effectiveDate;
}
@Override
public boolean equals(Object obj) {
if(obj==this)
return true;
if(!(obj instanceof CostDTO))
return false;
CostDTO c = (CostDTO) obj;
return c.costid.equalsIgnoreCase(this.costid);
}
@Override
public int hashCode() {
int result =17;
result =31 * result + costid.toLowerCase().hashCode();
return result;
}
}
//interface
package com.sa.dtoTest;
public interface CostCaluculator {
public CostDTO add(CostDTO arg1, CostDTO arg2);
public CostDTO subtract(CostDTO arg1, CostDTO arg2);
}
//test
package com.sa.dtoTest;
import java.math.BigDecimal;
import javapractice.date;
public class test {
public static void main(String[] args) {
CostDTO cD = new CostDTO("gold",new BigDecimal("40.732"),new date());
CostCaluculator c = new caluculator();
c.add(cD, new CostDTO("Gold",new BigDecimal("40.732"),new date()));
}
}