Why doesn't Intellij recognize the class "Rectangle" Follow Answered Drnardy Created September 07, 2018 07:47 Hi, does anyone know why Intellij does not recognise the class Rectangle? The characters are in red and grey.
"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!