Question: public class Machine { private String name; private int id; private Part part; } public Machine (String xname, int xid) { name = xname;
public class Machine { private String name; private int id; private Part part; } public Machine (String xname, int xid) { name = xname; id = xid; part == null; } ) Assume the following Machine and Part classes: public class Part { private String type; private int num; private Machine machine; } } public Part (String xtype, int xnum) { type = xtype; num = xnum; machine= null; Puce CN Public Write a Java method in the Machine class to create a new part object.
Step by Step Solution
3.56 Rating (149 Votes )
There are 3 Steps involved in it
Certainly To create a new Part object in the Machine class you can add a method ca... View full answer
Get step-by-step solutions from verified subject matter experts
