I have the following code:
Socket clientSocket = null;
try {
clientSocket = serverSocket.accept();
} catch (IOException e) {
System.err.println("Accept failed.");
System.exit(1);
}
The code is taken from a java.sun.com.
I have several questions concerning the above given short part of the code.
Why do we want to catch an IOException. I though that IOException is something that can happen when we use input-output methods (not networking methods).
What is the difference between the "System.err.println" and "System.println"?
In the catch statement we have "e". What for? Do we use it latter?