Explain me what are the important methods of Java Exception Class?
Submitted by: MuhammadMethods are defined in the base class Throwable. Some of the important methods of Java exception class are stated below.
☛ String getMessage() – This method returns the message String about the exception . The message can be provided through its constructor.
☛ public StackTraceElement[] getStackTrace() – This method returns an array containing each element on the stack trace. The element at index 0 represents the top of the call stack whereas the last element in the array represents the method at the bottom of the call stack.
☛ Synchronized Throwable getCause() – This method returns the cause of the exception or null id as represented by a Throwable object.
☛ String toString() – This method returns the information in String format. The returned String contains the name of Throwable class and localized message.
☛ void printStackTrace() – This method prints the stack trace information to the standard error stream.
Submitted by: Muhammad
☛ String getMessage() – This method returns the message String about the exception . The message can be provided through its constructor.
☛ public StackTraceElement[] getStackTrace() – This method returns an array containing each element on the stack trace. The element at index 0 represents the top of the call stack whereas the last element in the array represents the method at the bottom of the call stack.
☛ Synchronized Throwable getCause() – This method returns the cause of the exception or null id as represented by a Throwable object.
☛ String toString() – This method returns the information in String format. The returned String contains the name of Throwable class and localized message.
☛ void printStackTrace() – This method prints the stack trace information to the standard error stream.
Submitted by: Muhammad
Read Online Sr.Java Web Developer Job Interview Questions And Answers
Top Sr.Java Web Developer Questions
☺ | Do you know what is composition in Java? |
☺ | Please explain what is the difference between execute, executeQuery, executeUpdate? |
☺ | Tell us what is Hibernate Framework? |
☺ | Tell me what are the different tags provided in JSTL? |
☺ | Tell us what is difference between Error and Exception? |
Top Java Programming Language Categories
☺ | Core Java Interview Questions. |
☺ | Hibernate Interview Questions. |
☺ | Advanced Java Interview Questions. |
☺ | IBM WebSphere Interview Questions. |
☺ | Spring Framework Interview Questions. |