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?

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

 

 

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?

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education