Question 2
Consider the following code.
Consider the following code.
class Equipment implements Cloneable{ String type; // Constructor // Accessor method getType() // Mutator method setType() public Equipment clone() throws CloneNotSupportedException{ return (Equipment)super.clone(); }}class Lab implements Cloneable{ Equipment eqp; String name; // Constructor // Mutator method setName() public Lab clone() throws CloneNotSupportedException{ Lab lb = (Lab)super.clone(); lb.eqp = lb.eqp.clone(); return lb; } public String toString(){ return eqp.getType() + ":" + name; }}public class Test { public static void main(String[] args) { Lab lb1 = new Lab(new Equipment("Computer"), "Computer"); try{ Lab lb2 = lb1.clone(); lb2.eqp.setType("Milling Machine"); lb2.setName("Mechanical"); System.out.println(lb1); System.out.println(lb2); } catch(Exception e){ System.out.println(e); } }}What will the output be?