Why do I have to give an identifier?
- by Knowing me knowing you
In code:
try
{
System.out.print(fromClient.readLine());
}
catch(IOException )//LINE 1
{
System.err.println("Error while trying to read from Client");
}
In code line marked as LINE 1 compiler forces me to give an identifier even though I'm not using it. Why this unnatural constrain? And then if I type an identifier I'm getting warning that identifier isn't used. It just doesn't make sense to me, forcing a programmer to do something unnecesarry and surplus. And after me someone will revise this code and will be wondering if I didn't use this variable on purpouse or I just forgot. So in order to avoid that I have to write additional comment explaining why I do not use variable which is unnecessary in my code.
Thanks