1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Oliga [24]
4 years ago
13

2. You have classes to represent different shapes (see below). You realize you can benefit from inheritance and polymorphism by

creating a superclass for all shapes. a. Create such a superclass. b. Did you choose an abstract class or an interface for your answer to part a? c. Why did you make this choice?
Computers and Technology
1 answer:
Keith_Richards [23]4 years ago
6 0

Answer:

The description for the given question is described in the explanation section below.

Explanation:

a...

interface Shape

{

public double getArea();    // creating a function

public double getPerimeter();   // creating a function

}

b and c...

  • I preferred Interface although abstract classes are being used when children's classes associate certain aspect methods and variables and because all classes represent a certain method throughout the specific solution, not instance variables, it would be easier to construct an interface.
  • Almost all of the period interfaces are favored because they have multiple inheritance capabilities.

You might be interested in
Which is the fastest memory in computer​
Misha Larkins [42]

Answer:Cache memory

Explanation:

Cache memory is the fastest system memory, required to keep up with the CPU as it fetches and executes instructions. The data most frequently used by the CPU is stored in cache memory. The fastest portion of the CPU cache is the register file, which contains multiple registers.

8 0
3 years ago
Read 2 more answers
What did Francis Ford Coppola and George Lucas create?
garik1379 [7]
. 3d animation markers
7 0
3 years ago
What is alphabet symmetry
Nataly [62]
A line of symmetry creates two congruent figures that are mirror images of each other
3 0
3 years ago
Read 2 more answers
Which kind of image is indispensable and needs added text to go with it?
madreJ [45]

Answer:

A chart and a graph are kind of image that are indispensable and need added text to go with it.

4 0
3 years ago
How can you make sure to save all annotations from a slide show?
valentinak56 [21]

Answer:

The answer is A.

Explanation:

I just did this question on Edge2021.

7 0
3 years ago
Read 2 more answers
Other questions:
  • You just realized the turn signal on your vehicle is broken,
    15·1 answer
  • Your computer running Windows 7 is doing some very strange things with the operating system. You are fairly certain it is not a
    10·1 answer
  • 4. A friend knows you are taking a technology class in college and asks you how a hard drive works. In your own words, describe
    6·1 answer
  • Which of these components is a part of the central processing unit (cpu) of a computer??
    14·1 answer
  • By default, the Windows desktop displays
    6·1 answer
  • A _____ is inserted so that a portion of a document that can have different formatting from the rest of the document. a. heading
    9·1 answer
  • When a module is executing what happens when the end of the module is reached?
    10·1 answer
  • (a) [5 pts] Suppose you purchase a wireless router and connect it to your cable modem. Also suppose that your ISP dynamically as
    13·1 answer
  • Adobe Indesign project 4 museum indesign file. The instructions are 70 pages long I cant sit still long enough to read them
    11·1 answer
  • It is where your cpu (processor) is installed
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!