IDNLearn.com makes it easy to get reliable answers from knowledgeable individuals. Discover detailed and accurate answers to your questions from our knowledgeable and dedicated community members.
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;
Your participation means a lot to us. Keep sharing information and solutions. This community grows thanks to the amazing contributions from members like you. Your questions find clarity at IDNLearn.com. Thanks for stopping by, and come back for more dependable solutions.