JDB Exception Handling - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
JDB Exception Handling

JDB Exception Handling

Exception is an event that disrupts the normal flow of the program. Thus, it is important to handle these exceptions.
Like Java, Java Debugger (JDB) is also capable to handle these exceptions. The JDB catch command caught the exceptions at runtime.

Example of Exception Handling

In this example, we will handle arithmetic exception through JDB command on console.

JException.java

 public class JException  

{  

int div(int a,int b)  

{  

return a/b;  

}  

public static void main( String...jtp)  

{  

JException obj=new JException();  

System.out.println(obj.div(10,0));  

}  

}  

  • Compile the above program and create a JDB session.
  • After the execution of program the following exception occurs:

About Mariano

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.