R
Roedy Green
Consider this code:
try
{
in = fileOpen();
}
catch ( IOException e )
{
e.printStackTrace();
System.exit(1);
}
If you try to use variable in, Java warns it may not be initialised.
It thinks System.exit() may return.
I have put code in like this:
catch ( IOException e )
{
e.printStackTrace();
System.exit(1);
return;
}
to reassure it, though that looks goofy. What do you do?
try
{
in = fileOpen();
}
catch ( IOException e )
{
e.printStackTrace();
System.exit(1);
}
If you try to use variable in, Java warns it may not be initialised.
It thinks System.exit() may return.
I have put code in like this:
catch ( IOException e )
{
e.printStackTrace();
System.exit(1);
return;
}
to reassure it, though that looks goofy. What do you do?