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
laiz [17]
3 years ago
8

1. Write a toString method for this class. The method should return a string containing the radius and area of the circle.

Computers and Technology
1 answer:
Lady bird [3.3K]3 years ago
6 0

Answer:

public class Circle {

private double radius;

public Circle(double r)

{

radius = r;

}

public double getArea()

{

return Math.PI * radius * radius;

}

public double getRadius()

{

return radius;

}

public String toString()

{

String str;

str = "Radius: " + radius +

"Area: " + getArea();

return str;

}

public boolean equals(Circle c)

{

boolean status;

if(c.getRadius() == radius)

status = true;

else

status = false;

return status;

}

public boolean greaterThan(Circle c)

{

boolean status;

if(c.getArea() > getArea())

status = true;

else

status = false;

return status;

}

}

Explanation:

There is nothing with the logic of your code it work fine the problem is with the structure of your code you added an extra  curly brace before declaring (r)

****************************** Am talking about this section **********************

public class Circle {

{

private double radius;

****************************   It should be    *******************************************

public class Circle {

private double radius;

You might be interested in
Amanda wants to prevent sensitive data from being sent via email in her organization. What type of agent software can she instal
melamori03 [73]

The type of agent software can she install on her systems to identify properly categorized or tagged information before it leaves the company is a strong antivirus software.

<h3>What are some ways to handle against email phishing attacks?</h3>

People are known to have system and they are said to have different kinds of attacks from outside sources. The ways to protect yourself from Phishing are:

  • Be on guard towards the  handing of sensitive information.
  • Never click on alarming messages.
  • Do not open any form of attachments that is suspicious or strange.

Learn more about  phishing attacks from

brainly.com/question/2537406

8 0
2 years ago
A __________ note is a private note that you leave for yourself or for other people who might use the presentation file
BaLLatris [955]

Answer:

The answer is that it is a speaker note.

Explanation:

It leaves a note for people that use presentation files. I use it all the time on my google slides.

7 0
3 years ago
40 points!!! Which of the following is a disadvantage of outsourcing?
mr Goodwill [35]

Answer:

c

Explanation:

I need 20 characters in my answer so tvcogct7zr7zuruzxicfficx7t8txr8zz8rz8rxt8c8tvyovoyb9h

8 0
3 years ago
Read 2 more answers
Assume a program requires the execution of 50 x 106 (50e6) FP instructions, 110 x 106 (110e6) INT instructions, 80 x 106 (80e6)
tresset_1 [31]

Answer:I really don’t know

Explanation:

Um You can look it up though

7 0
3 years ago
In Microsoft Word, when you highlight existing text you want to replace, you are in
kirill115 [55]
The correct answer is C. Typeover mode

This is when you select a text and can then type over it and it automatically replaces it with what you're writing. It also creates a little box that lets you edit the selected part easily if that's what you need with things like bold or italic or change the text color.
6 0
3 years ago
Other questions:
  • Array elements must be ________ before a binary search can be performed.
    8·1 answer
  • Tab stops are very useful when you want to A. align text into rows. B. add space between paragraphs. C. align text into columns.
    14·2 answers
  • Of which of the following devices are point, drag, and click actions?
    15·1 answer
  • Which finger types the return or enter key?
    6·2 answers
  • You open the home page for www.alpineskihouse. On the home page, you see a link for the weather report. You want to view the wea
    6·1 answer
  • Define get_date() function.
    6·1 answer
  • Indicate whether the statement is true or false. ____ 1. Autoglobal array elements are referred to with an index number. ____ 2.
    9·1 answer
  • I really want to know the best way to deal as much heart as possible plz tell me
    7·2 answers
  • Which statements about grades are accurate? Check all that apply. Grades help indicate how well a student is understanding a cer
    13·1 answer
  • Which file formats have relatively small file size and are therefore the most widely used formats for sharing and
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!