Multiple Choice
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) ;
A) length = 14; width = 10
B) length = 9; width = 5
C) length = 14; width = 5
D) None of these
Correct Answer:

Verified
Correct Answer:
Verified
Q1: Given the declaration public class MyClass {private
Q3: Which of the following is used to
Q4: Class members consist of all of the
Q5: MysteryClass<br>-first: int<br>-second: double;<br>+MysteryClass()<br>+MysteryClass(int)<br>+MysteryClass(double);<br>+MysteryClass(int, double)<br>+setData(int, double): void<br>+getFirst(): int<br>+getSecond():
Q6: Which of the following words indicates an
Q7: How many finalizers can a class have?<br>A)
Q16: Classes that are defined within other classes
Q22: Constructors are called like any other method.
Q27: Not every user-defined class can override the
Q49: If a member of a class is