Consider the following statements.public class Rectangle{   …

Consider the following statements.public class Rectangle{    private double length;    private double width;    public Rectangle()    {        length = 0;        width = 0;    }    public Rectangle(double l, double w)    {        length = l;        width = w;    }    public void set(double l, double w)    {        length = l;        width = w;    }    public void print()    {        System.out.println(“Length = ” + length                   + “; Width = ” + width + “\n” +                  + ” Area = ” + area()                    + “; Perimeter = ” + perimeter());    }    public double area()    {        return length * width;    }    public void perimeter()    {        return 2 * length + 2 * width;    }    public void makeCopy(Rectangle otherRect)    {        length = otherRect.length;        width = otherRect.width;    }}   Rectangle tempRect = new Rectangle(14, 10);Rectangle newRect = new Rectangle(9, 5);What are the values of the instance variables of newRect after the following statement execute?newRect.makeCopy(tempRect);

What is the blueWidget’s inStock at the end of main( )? publ…

What is the blueWidget’s inStock at the end of main( )? public class Widget {   private int inStock;   public Widget() {      inStock = 10;   }   public void addInventory(int amt) {      inStock = inStock + amt;   }   public static void main(String [] args){      Widget blueWidget = new Widget();      Widget greenWidget = new Widget();      blueWidget.addInventory(15);      greenWidget.addInventory(5);   }}}

What is the value of hondaAccord’s odometer at the end of ma…

What is the value of hondaAccord’s odometer at the end of main( )? public class SimpleCar {   private int odometer;   public SimpleCar() {      odometer = 0;   }   public SimpleCar(int miles) {      odometer = miles;   }   public void drive(int miles) {      odometer = odometer + miles;   }       public static void main(String[] args) {      SimpleCar fordFusion = new SimpleCar();      SimpleCar hondaAccord = new SimpleCar(30);      fordFusion.drive(100);      fordFusion.drive(20);   }}

What is the greenWidget’s inStock at the end of main( )? pub…

What is the greenWidget’s inStock at the end of main( )? public class Widget {   private int inStock;   public Widget() {      inStock = 10;   }   public void addInventory(int amt) {      inStock = inStock + amt;   }   public static void main(String [] args){      Widget greenWidget = new Widget();      greenWidget.addInventory(15);      greenWidget.addInventory(5);   }}}  

What is the value of fordFusion’s odometer at the end of mai…

What is the value of fordFusion’s odometer at the end of main( )?   public class SimpleCar {   private int odometer;   public SimpleCar() {      odometer = 0;   }   public SimpleCar(int miles) {      odometer = miles;   }   public void drive(int miles) {      odometer = odometer + miles;   }       public static void main(String[] args) {      SimpleCar fordFusion = new SimpleCar();      SimpleCar hondaAccord = new SimpleCar(30);      fordFusion.drive(100);      fordFusion.drive(20);   }}