I have a figure need to convert to Java code..
Is this Java code correct?
class Insurance_company {
private ArrayList<contract> Insurance_contract;
}
class Insurance_contract {
private Insurance_company company;
}
CodePudding user response:
There is no contract
class, so that Arraylist type is incorrect.
The company has zero-to-many contracts.
class Insurance_company {
private List<Insurance_contract> contracts;
}
Your Insurance_contract
seems correct.