System.out.println("hello") analyze error

Hello there,

I use version 14.0.2.  When I write just one line code:
System.out.println("hello");

in main static method,

Analyze compain that "hello" with "class or interface expected".

But it can compile and run well.

If I change to

System.out.println(new String("hello"));

It won't compain the error.

What's wrong? Is this a bug?  Thanks for reply in advanced.

2 comments
Comment actions Permalink

It's my fault. Accidently set the string literal as injection language with java.

Unreg/uncheck the println function with injection solved the problem.

0
Comment actions Permalink

it's better that the IDE provide a hint when it prompt errors in such circumstance. It's very difficult for new users to figure out. It did cause me much time to figure this out. It won't have any actual impact, but it's very anoy !

0

Please sign in to leave a comment.