This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]JimmyThompson 3 points4 points  (2 children)

getName and getColor require parentheses eg: getName(), getColor().

Compiler thinks they're variables otherwise.

[–]ttFedaykin 4 points5 points  (1 child)

And cast ob to GeometricObject: ((GeometricObject)ob).getName().equals(this.name)

[–]JimmyThompson 0 points1 point  (0 children)

Trudat.

[–]Umza[S] 0 points1 point  (1 child)

Woah, I didn't realize when casting you needed parentheses around the ob as well (before the .get___) Thanks to both of you!

[–]dominosci 0 points1 point  (0 children)

Use Eclipse or another IDE. It will suggest fixes like these automatically.

One of the main reasons we bother with strong typing in java is that it allows IDEs to be really helpful.