Class ProtocolException in Java

Share and Enjoy !

Class ProtocolException in Java

ProtocolException is common exception classes in java and is thrown from an application to indicate that there is an error in the underlying protocol like TCP Error.It is thrown from the Socket class.

A ProtocolException is thrown to indicate that there has been an error in an underlying protocol, such as an HTTP or TCP protocol error.

The class ProtocolException is defined as :

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

The class ProtocolException 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 NotSerializableException in Java

Leave a Reply

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