Home > Net >  How can I convert a diagram to Java code?
How can I convert a diagram to Java code?

Time:05-22

I have a figure need to convert to Java code..

This is the figure: figure

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.

  • Related