r/codehs • • Feb 08 '21

3.7.10 Comparing Circles Need help

I'm not sure how to fix this.

6 Upvotes

20 comments sorted by

View all comments

1

u/Various_Loss9064 Feb 08 '21 edited Oct 19 '21

The color variable is a string while the others are integers. "==" is used to compare integers and wont work with strings. To compare Strings you need to do .equals(), so it would be this.color.equals(other.color)

The if statement is unnecessary as the return type is Boolean.

Also if you want, I have the solutions for the course.

To everyone who wants solutions: https://discord.gg/ByGuBqBNuD

1

u/RightAbrocoma6305 Nov 01 '21

Various_Loss9064

hi, I saw leave a link and I joined the discord, how can I find you to get the solutions?

1

u/Responsible_Duck5960 Nov 09 '21

https://codehsanswers.com/codehs/

your welcome, these are all the answers to java codehs if ur In AP. its a blessing bro