Menu

#19 Lousy error message for assignment to non-blank final field

Nice_to_Have
open
nobody
5
2012-11-27
2003-04-11
No

The error message for assignment to non-blank final
fields within a constructor is really awful. Contrast
the results of compiling:

public class A {
final int x = 0;
A() { x = 1; }
}

and

public class B {
final int x;
B() { x = 0-; x = 1; }
}

Discussion


Log in to post a comment.