R
Roedy Green
Consider the following code
static final String allpads;
static
{
try
{
allPads = HunkIO.readEntireFile( ALLPADS_FILE );
}
catch ( IOException e )
{
err.println( "Unable to access allPads.pad" );
allPads = null;
}
}
According to the IntelliJ inspector, this allPads should be final.
But according to Javac, it should not, claiming I might be trying to
redefine a final.
Which is correct and why?
--
Roedy Green Canadian Mind Products
http://mindprod.com
"Species evolve exactly as if they were adapting as best they could to a changing world, and not at all as if they were moving toward a set goal."
~ George Gaylord Simpson
static final String allpads;
static
{
try
{
allPads = HunkIO.readEntireFile( ALLPADS_FILE );
}
catch ( IOException e )
{
err.println( "Unable to access allPads.pad" );
allPads = null;
}
}
According to the IntelliJ inspector, this allPads should be final.
But according to Javac, it should not, claiming I might be trying to
redefine a final.
Which is correct and why?
--
Roedy Green Canadian Mind Products
http://mindprod.com
"Species evolve exactly as if they were adapting as best they could to a changing world, and not at all as if they were moving toward a set goal."
~ George Gaylord Simpson