I have just started learning Java a few weeks ago. I'm trying to learn the key word final in java language. I wrote a final string
statement in the public static void main
method. However, the IDE is displaying the error: illegal start expression. However, the IDE did not provide any additional information. Because I'm relatively new to Java, I am unable to understand why this is happening. Could someone please explain the reason to me?
public static void main(String[] args) {
private final String s1 = "hello world";
}