Find the best solutions to your questions at Westonci.ca, the premier Q&A platform with a community of knowledgeable experts. Experience the convenience of getting reliable answers to your questions from a vast network of knowledgeable experts. Get detailed and accurate answers to your questions from a dedicated community of experts on our Q&A platform.
Sagot :
Answer:
public class Person {
//fields
private int id;
private String name;
private Payment pay;
//constructor
public Person(String name, int id,
int startSal, int startBon){
this.name = name;
this.id = id;
this.pay = new Payment(startSal, startBon);
}
//method get name
public String getName(){
return name;
}
//method get id
public int getId(){
return id;
}
//method get start salary
public int getStartSalary(){
return pay.startSalary;
}
//method get start bonus
public int getStartBonus(){
return pay.startBonus;
}
//inner payment class
private class Payment{
int startSalary;
int startBonus;
public Payment(int sal, int bon){
this.startSalary = sal;
this.startBonus = bon;
We appreciate your visit. Hopefully, the answers you found were beneficial. Don't hesitate to come back for more information. Thank you for your visit. We're dedicated to helping you find the information you need, whenever you need it. We're glad you chose Westonci.ca. Revisit us for updated answers from our knowledgeable team.