I\'m trying to run this practice script from the standard Oracle Java tutorials.
This seems to be a common error and I\'ve used SO resources to make attempts to fix
For idea IntelliJ you need to go to Menu-> Project Structure -> Module here you will see Source tab, above this tab you can see language level. change it to more than 8.
-yash