I am an absolute Java newbie and just got started learning Java. I came across this JShell functionality within IntelliJ where one can write some quick code without writing any class constructs. But the problem which annoys me for quite some time is that when I initialized even a simple ArrayList, it seems to be working fine but it always gives me this "Expression expected" error which underlines List<Integer>
in red.
I do not encounter such error while in a normal .java file but only in JShell.
Does anyone know why? Much appreciated in advance!