Define the following 2 classes to represent 2-dimensional objec.pdf

Define the following 2 classes to represent 2-dimensional objects. Super Class: Shape It should have - 2 member variables: length, and breadth of integer types. - 2 argument constructor for length and breadth which stores the argume their corresponding member variables. - A method, area(), which prints the length and breadth of the shape, delin by a space. Concrete Class: Rectangle It should have - 2 argument constructor for length and breadth. It should forward those arguments to the superclass constructor. - Override the area() method to print the area using the formula (length*breadth). - 2 argument constructor for length and breadth. It should forward those arguments to the superclass constructor. - Override the area() method to print the area using the formula (length*breadth). Constraints - 0< length 1000 - 0< breadth 1000 Input Format for Custom Testing Sample Case 0 Sample Input For Custom Testing 45 Sample Output 45 20 Maps Language.

Define the following 2 classes to represent 2-dimensional objects. Super Class: Shape It should
have - 2 member variables: length, and breadth of integer types. - 2 argument constructor for
length and breadth which stores the argume their corresponding member variables. - A method,
area(), which prints the length and breadth of the shape, delin by a space. Concrete Class:
Rectangle It should have - 2 argument constructor for length and breadth. It should forward those
arguments to the superclass constructor. - Override the area() method to print the area using the
formula (length*breadth).
- 2 argument constructor for length and breadth. It should forward those arguments to the
superclass constructor. - Override the area() method to print the area using the formula
(length*breadth). Constraints - 0< length 1000 - 0< breadth 1000 Input Format for Custom
Testing Sample Case 0 Sample Input For Custom Testing 45 Sample Output 45 20
Maps Language

Más contenido relacionado

Similar a Define the following 2 classes to represent 2-dimensional objec.pdf(20)

DSP-Finite Word Length EffectsDSP-Finite Word Length Effects
DSP-Finite Word Length Effects
Senthil Kumar K2.9K views
Lec 8 03_sept [compatibility mode]Lec 8 03_sept [compatibility mode]
Lec 8 03_sept [compatibility mode]
Palak Sanghani451 views
Pj01 3-java-variable and data typesPj01 3-java-variable and data types
Pj01 3-java-variable and data types
SasidharaRaoMarrapu77 views
 primitive data types primitive data types
primitive data types
Jadavsejal95 views
Cs 72 (p)s2Cs 72 (p)s2
Cs 72 (p)s2
Web Developer629 views
java Basic Programming Needsjava Basic Programming Needs
java Basic Programming Needs
Raja Sekhar3.4K views
Chapter 6 data types Chapter 6 data types
Chapter 6 data types
Arafat X1.5K views
The Chimera Grid Concept and Application The Chimera Grid Concept and Application
The Chimera Grid Concept and Application
Putika Ashfar Khoiri764 views

Más de allurafashions98(20)

Último(20)

Nico Baumbach IMR Media ComponentNico Baumbach IMR Media Component
Nico Baumbach IMR Media Component
InMediaRes1368 views
Structure and Functions of Cell.pdfStructure and Functions of Cell.pdf
Structure and Functions of Cell.pdf
Nithya Murugan256 views
231112 (WR) v1  ChatGPT OEB 2023.pdf231112 (WR) v1  ChatGPT OEB 2023.pdf
231112 (WR) v1 ChatGPT OEB 2023.pdf
WilfredRubens.com118 views
Azure DevOps Pipeline setup for Mule APIs #36Azure DevOps Pipeline setup for Mule APIs #36
Azure DevOps Pipeline setup for Mule APIs #36
MysoreMuleSoftMeetup84 views
Narration lesson plan.docxNarration lesson plan.docx
Narration lesson plan.docx
TARIQ KHAN92 views
Sociology KS5Sociology KS5
Sociology KS5
WestHatch52 views
Industry4wrd.pptxIndustry4wrd.pptx
Industry4wrd.pptx
BC Chew157 views
Class 10 English  lesson plansClass 10 English  lesson plans
Class 10 English lesson plans
TARIQ KHAN189 views
Drama KS5 BreakdownDrama KS5 Breakdown
Drama KS5 Breakdown
WestHatch54 views
SIMPLE PRESENT TENSE_new.pptxSIMPLE PRESENT TENSE_new.pptx
SIMPLE PRESENT TENSE_new.pptx
nisrinamadani2159 views
GSoC 2024GSoC 2024
GSoC 2024
DeveloperStudentClub1056 views
ICANNICANN
ICANN
RajaulKarim2061 views
ACTIVITY BOOK key water sports.pptxACTIVITY BOOK key water sports.pptx
ACTIVITY BOOK key water sports.pptx
Mar Caston Palacio275 views
2022 CAPE Merit List 2023 2022 CAPE Merit List 2023
2022 CAPE Merit List 2023
Caribbean Examinations Council3.5K views
Dance KS5 BreakdownDance KS5 Breakdown
Dance KS5 Breakdown
WestHatch53 views
Plastic waste.pdfPlastic waste.pdf
Plastic waste.pdf
alqaseedae94 views

Define the following 2 classes to represent 2-dimensional objec.pdf

  • 1. Define the following 2 classes to represent 2-dimensional objects. Super Class: Shape It should have - 2 member variables: length, and breadth of integer types. - 2 argument constructor for length and breadth which stores the argume their corresponding member variables. - A method, area(), which prints the length and breadth of the shape, delin by a space. Concrete Class: Rectangle It should have - 2 argument constructor for length and breadth. It should forward those arguments to the superclass constructor. - Override the area() method to print the area using the formula (length*breadth). - 2 argument constructor for length and breadth. It should forward those arguments to the superclass constructor. - Override the area() method to print the area using the formula (length*breadth). Constraints - 0< length 1000 - 0< breadth 1000 Input Format for Custom Testing Sample Case 0 Sample Input For Custom Testing 45 Sample Output 45 20 Maps Language