All About Class Exception in Java

0
19
Spread the love
  • 1
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    1
    Share


The class Exception and its subclasses are a form of throwable objects that indicates conditions that can be caught using a catch clause in the code.
The structure of the Exception class is given below:

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

}
 

This message is used later to extract information from the Exception.

Don't miss out!
Subscribe To Newsletter

Receive top technical news, lesson ideas, travel tips and more!

Invalid email address
Give it a try. You can unsubscribe at any time.

Spread the love
  • 1
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    1
    Share

LEAVE A REPLY

Please enter your comment!
Please enter your name here