Class SocketException in Java

digitization, transformation, binary

Class SocketException in Java

SocketException is thrown from the application to indicate that some exception happened while attempting to use a socket.

A SocketException is thrown when an error occurs while a socket is being used. As of now, there are some more specific subclasses of SocketException, namely BindException, ConnectException, and NoRouteToHostException.

Ads code goes here

The class SocketException is given below:

public class java.io.SocketException extends java.lang.IOException{
//constructor
public SocketException();//constructs an empty SocketException object that is an object with no message specified.
public SocketException(String message);//constructs an SocketException object with the message specified.
}

The class SocketException also inherits methods from class Object and Throwable.

From Object classFrom Throwable class
clone()fillInStackTrace()
getClass()getMessage()
notify()printStackTrace()
wait()printStackTrace(PrintWriter)
wait(long, int)getLocalizedMessage()
wait(long)printStackTrace(PrintStream)
equals(Object)
toString()
finalize()
hashCode()
notifyAll()

Share and Enjoy !

READ  Class BufferedReader in Java

Leave a Comment

Your email address will not be published. Required fields are marked *