Why doesn't Intellij recognize the class "Rectangle"

Answered

Hi, does anyone know why Intellij does not recognise the class Rectangle? The characters are in red and grey. 




0
5 comments

Hello,

"Rectangle" is not in the same package as "Main" and it is not imported there. That's why class is not found.

 

0

Hello. Sorry for being such a noob and thank you for your reply but how can I import "Rectangle" into main?

0

You could put it into "com/kermit" package or into "com/<new package>", then put caret on "Rectangle" in Main, press Alt+Enter and select import class.

0

And it works! Thank you for teaching!

0

Please sign in to leave a comment.