class Rectangle{ 2 int length,width,length1; 3 void insert(int l,int w){ 4 length=1; 5 width=w; 6 } 7 void insert(int 1){ 8 length1=1; 9 } 10 void display1() 11 { 12 System.out.println(width); 13 } 14 void display2() 15 { 16 System.out.println(length); 17 } 18 void calculateArea() 19 { 20 System.out.println(length*width); 21 22 } 23 void calculateArea3() 24 { 25 System.out.println(length1); 26 } 27 void calculateArea2() 28 { 29 System.out.println(length width 2); 30 } 31 } 32 class Test Rectangle2{ public static 33 void main(String args[]){ 34 Rectangle r1-new Rectangle(); 35 Rectangle r2-new Rectangle(); 36 Rectangle r3-new Rectangle(); 37 r1.insert(10,5); 38 r2.insert(3,5); 39 r3.insert(2); 40 r1.display1(); 41 r1.display2(); 42 r1.calculateArea(); 43 r2.calculateArea2(); 44 r2.display1(); 45 r2.display2(); 46 r2.calculateArea(); 47 r2.calculateArea2(); 48 r3.calculateArea3(); 49 r3.display1(); 50 } 51 } ANSWER THE FF QUESTION : a. What is the output of line 40? b. What is the output of line 41? c. What is the output of line 42? d. What is the output of line 43? e. What is the output of line 44? f. What is the output of line 45? g. What is the output of line 46? h. What is the output of line 47? i. What is the output of line 48? j. What is the output of line 49?
Write the output of the following statement :
LINE
1 class Rectangle{
2 int length,width,length1;
3 void insert(int l,int w){
4 length=1;
5 width=w;
6 }
7 void insert(int 1){
8 length1=1;
9 }
10 void display1()
11 {
12 System.out.println(width);
13 }
14 void display2()
15 {
16 System.out.println(length);
17 }
18 void calculateArea()
19 {
20 System.out.println(length*width);
21
22 }
23 void calculateArea3()
24 {
25 System.out.println(length1);
26 }
27 void calculateArea2()
28 {
29 System.out.println(length width 2);
30 }
31 }
32 class Test Rectangle2{ public static 33 void main(String args[]){
34 Rectangle r1-new Rectangle();
35 Rectangle r2-new Rectangle();
36 Rectangle r3-new Rectangle();
37 r1.insert(10,5);
38 r2.insert(3,5);
39 r3.insert(2);
40 r1.display1();
41 r1.display2();
42 r1.calculateArea();
43 r2.calculateArea2();
44 r2.display1();
45 r2.display2();
46 r2.calculateArea();
47 r2.calculateArea2();
48 r3.calculateArea3();
49 r3.display1();
50 }
51 }
ANSWER THE FF QUESTION :
a. What is the output of line 40?
b. What is the output of line 41?
c. What is the output of line 42?
d. What is the output of line 43?
e. What is the output of line 44?
f. What is the output of line 45?
g. What is the output of line 46?
h. What is the output of line 47?
i. What is the output of line 48?
j. What is the output of line 49?
Step by step
Solved in 2 steps