Run ❯
Get your
own
website
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
public class Main { public static void main(String[] args) { final int myNum = 15; myNum = 20; // will generate an error System.out.println(myNum); } }
Main.java:4: error: cannot assign a value to final variable myNum
myNum = 20;
^
1 error