I want to do
public class Settings
{
static final URL logo = new URL("http://www.example.com/pic.jpg");
// and other static final stuff...
}
but I get told that I need to handle MalformedURLException. THe specs say that MalformedURLException is
Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a specification string or the string could not be parsed.
Now, I know that the URL I give is not malformed, so I'd rather not handle an exception I know cannot occur.
Is there anyway to avoid the unnecessary try-catch-block clogging up my source code?