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
Westkost [7]
4 years ago
9

Although saying "Cylinder IS A Circle" doesn't make sense, it can be implemented in Java using inheritance in a legitimate way.

Implement Circle and Cylinder classes with fields, constructors and methods required to demonstrate all aspects of legitimate inheritance.
Computers and Technology
1 answer:
allochka39001 [22]4 years ago
8 0

Answer:

I've included in the codes the area to circle and volume to cylinder. The Volume method that was used, area() to compute, the volume of cylinder which shows that cylinder is an expansion of circle with an extra dimension (height)

Explanation:

Temp is tester class

public class Temp {

   public static void main(String[] args) {

       Circle c = new Circle(7);

       System.out.println("Area of circle with radius 7 is "+c.area());

       Cylinder c1 = new Cylinder(7,10);

       System.out.println("Cylinder volume with radius 7 and height 10: "+c1.volume());

   }

}

----------------------------------------------------------------------------------------------------

class Circle{

   int radius;

   Circle(int r){

       radius=r;

   }

   double area(){  //area of circle

       return 3.14*radius*radius;

   }

   public int getRadius() {

       return radius;

   }

   public void setRadius(int radius) {

       this.radius = radius;

   }

}

class Cylinder extends Circle{

   int height;

   Cylinder(int r, int h){

       super(r);

       height=h;

   }

   double volume(){  //volume of cylinder

       return area()*height;

   }

   public int getHeight() {  //accessor

       return height;

   }

   public void setHeight(int height) {  //mutator

       this.height = height;

   }

}

You might be interested in
Three reasons why users attach speakers to their computer
Alla [95]
For media sound
For the game's multimedia sound
For essential system sound
5 0
3 years ago
The term callee save denotes the case where the __________ (calling / called) program saves the contents of registers whose cont
marysya [2.9K]

Answer:

The right approach is "called". The further explanation is described below.

Explanation:

  • Callee saved suggests that whenever the feature returns or exists, the callee needs to save other registrations and afterward recover them at either the conclusion of the conversation even though they have the promise for the caller just to maintain these very same values.
  • It's indeed necessary to retrieve them, even though at any stage mostly during call individuals are pummeling.
4 0
3 years ago
A major weakness of a lot of file processing systems is that ____.
Gnesinka [82]

They are several weaknesses or disadvantages of file processing systems but the major weakness is data redundancy and inconsistency. By data redundancy, I mean duplication of data. There are no better methods to validate insertion of duplicate data in file systems. Data redundancy can also increase the chance for errors.






7 0
4 years ago
Which of the following internet connection types is known to have a significantly higher latency than the others
Degger [83]
What are the options?
7 0
4 years ago
Assume you have 100 values that are all different, and use equal width discretization with 10 bins.
zepelin [54]

Answer:

a) 10

b) 1

C) 10

D) 1

E) 20

F)  10

Explanation:

a) The largest number of records that could appear in one bin

 = 10

B) The smallest number of records that could appear in one bin

= 1

C) The largest number of records that cab appear in one bin

= 10

d) smallest number

= 1

e) With frequency = 20. the largest number of records that could appear in one bin with equal width discretization (10 bins)

= 20

f ) with equal height discretization

= 10

6 0
3 years ago
Other questions:
  • Which type of color mixing do painters with a real brush and paints use?
    5·1 answer
  • Which of the following is an example of a wanted versus I need
    5·1 answer
  • Describe IT infrastructure. What is the role of business intelligence in determining the technology needs of a business?
    11·1 answer
  • What kind of software program delivers advertising content in a manner that is unexpected and unwanted by the user, and is typic
    14·1 answer
  • What are three attributes of the input tag
    5·1 answer
  • Under which menu option of a word processing program does a callout appear?
    7·2 answers
  • Signals that can travel in only one direction on a medium are referred to as what type of signal?
    12·1 answer
  • In cell B3, insert a nested MATCH function within an INDEX function that will look up the rental price in column D using the apa
    15·1 answer
  • An error in the sequence of words or rules in a program that prevents the program from running is what?
    10·2 answers
  • Please give me a answer correctly​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!