

Hi,
Here is the solution.
To debug Java program, we use 'jdb' which stands for Java debugger. The jdb is included in JDK 1.2 package. The Java Debugger API allows us to actually peek into the runtime and debug our code. The jdb is just one implementation of a debugger that uses the API.
Before debugging, you must include -g while compiling your class. This option tells the compiler to include debugging information in your class file.
To debug Java program, we use 'jdb' which stands for Java debugger. The jdb is included in JDK 1.2 package. The Java Debugger API allows us to actually peek into the runtime and debug our code. The jdb is just one implementation of a debugger that uses the API.
Before debugging, you must include -g while compiling your class. This option tells the compiler to include debugging information in your class file.
Debugging Procedure :
Step1 : Before debugging, you must include -g while compiling your class. This option tells the compiler to include debugging information in your class file.
Step2 : Set break point : You can set breakpoint using : stop in
Step 3: You can start debugging using run command . It debug code step by step, so if it haults , you can resume debugging by running cont command.
It gives result after executing each step and show you it's value to you and debugging stops after end of the code and will exit out of program.
Thanks.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.