Why is it not possible to initialize a final variable in a catch block?
Case Study 1 final String someString = "Hello World"; try { someString = "Hello"; } catch (RuntimeException e) { someString = "World"; } If we compile this code, we get two errors: Cannot assign a value to final variable ‘someString’ // Line 3 Cannot assign a value to final variable ‘someString’ // Line 5 This,… Read More Why is it not possible to initialize a final variable in a catch block?