0%
0 / 12 answered
this Keyword Practice Test
•12 QuestionsQuestion
1 / 12
Q1
What problem does this solve in the provided Rectangle class definition?
class Rectangle {
private int length;
private int width;
public Rectangle(int length, int width) {
this.length = length;
this.width = width;
this.printArea();
}
public void printArea() {
System.out.println(this.length * this.width);
}
}
What problem does this solve in the provided Rectangle class definition?
class Rectangle {
private int length;
private int width;
public Rectangle(int length, int width) {
this.length = length;
this.width = width;
this.printArea();
}
public void printArea() {
System.out.println(this.length * this.width);
}
}