Underscores in literals are not supported at this language level

I got this error when creating the final double, using underscores to make the double readable. It was declared in the run() method.

 public void run() { final double nanoSeconds = 1_000_000_000.0 / 60.0; } 

I am using IntelliJ IDEA 12.

+4
source share
2 answers

In IntelliJ IDEA you need to change the Project language level in the project settings to level 7.0 :

enter image description here

+13
source

Yes. You need to change the default language level settings, if you use, and the IDE. For IntelliJ users, this is located under File → Project Structure → Projects.

+2
source

Source: https://habr.com/ru/post/1485052/


All Articles