Why doesn't Intellij recognize the class "Rectangle"
已回答
Hi, does anyone know why Intellij does not recognise the class Rectangle? The characters are in red and grey.


请先登录再写评论。
Hello,
"Rectangle" is not in the same package as "Main" and it is not imported there. That's why class is not found.
Hello. Sorry for being such a noob and thank you for your reply but how can I import "Rectangle" into main?
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.
And it works! Thank you for teaching!
You are welcome!