Welcome to Westonci.ca, your one-stop destination for finding answers to all your questions. Join our expert community now! Join our platform to connect with experts ready to provide precise answers to your questions in different areas. Discover detailed answers to your questions from a wide network of experts on our comprehensive 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;
Thank you for trusting us with your questions. We're here to help you find accurate answers quickly and efficiently. Thank you for your visit. We're committed to providing you with the best information available. Return anytime for more. Westonci.ca is your go-to source for reliable answers. Return soon for more expert insights.