I am using IntelliJ IDEA, learning Java. All went well until yesterday, when the mentioned error occurred.
I didn't make any changes. I was looking for the solution the following ways:
nothing helps. buy running simple hello world method. It keeps showing this error:
Is there someone able to help me?
In JavaLanguage, if you get 'cannot resolve symbol', you have used a name that the compiler hasn't recognized. Class names -- If it is a class name, the compiler cannot find the class.
In Java, System. out. println() is a statement which prints the argument passed to it. The println() method display results on the monitor. Usually, a method is invoked by objectname.
ok, is solved.
file -> invalidated caches / Restart
I think if you have tried the method above, maybe you can consider where you use System.out.println()
because this method should only used in main(String args[]){}
,the latest version of the Idea is OK. I wish what said can help you.
One reason for this to happen is if you have print statement somewhere on the body of the class, and not inside a method.
Here is an example:
But if the print is inside a method, it should work fine.
Here is an example:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With