I'm trying to initialize a private final
variable in the constructor of my class. I found this thread explaining how to do it (Initialize a static final field in the constructor), but eclipse doesn't seem to like my code. I was wondering if someone could shed some light on what I might be doing wrong.
public class A {
final private String myString;
public A() {
myString = "content";
}
}
With this code I'm getting:
The blank final field myString may not have been initialized
This seems pretty dang similar to the examples in the thread I linked to.
Thank you for the help!