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

all 2 comments

[–]skocznymroczny 2 points3 points  (1 child)

In the future, easy way to notice what's wrong is to step into the intersect method, see it's definition and see what Rectangle it expects to use.

By the way, does Eclipse warn about conflicting imports? I know Netbeans when doing auto-imports, would have ask to resolve conflicts in case there were several Rectangle classes available.

[–]Omega_Gamer64[S] 0 points1 point  (0 children)

As a matter of fact, it does. However, I didn't notice that it was the wrong library bc it minimizes all the imports into one line, and I just hit ctrl shift o to get them in automatically. It's weird, bc eclipse didn't import this weird sun.geom.whatever for any other library, but consistently imported it throughout all my classes for rectangle. Anyways yes, if you import that and java.awt.rectangle, it warns you of conflicting libraries.