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.
Please sign in to leave a comment.
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!