samar
Java code debugging
1 Answer(s)      2 years and 7 months ago
Posted in : Java Interview Questions

How can you debug the Java code?
View Answers

October 29, 2010 at 3:39 PM


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 .[] OR stop at :

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.









Related Pages:
Java code debugging
Java code debugging  How can you debug the Java code
debugging techniques
debugging techniques  java program to accept the employee code from... of the employee code should be the letter 'E'. If it is any other letter, throw a user... is an example that validates employee code. The given code accepts the code from
Java: Debugging Output
Java: Debugging Output System.out.println The System.out.println is used to debug a java program. Here is one example code: class HelloWorld { public static void main(String[] args) { System.out.println("Hello
debugging javascript - Java Beginners
debugging javascript  hi all, can anybody tell me which is the best way to debug javascript?  Hi Friend, Use IE8 beta. It is very powerful and works well. Thanks
[Mini-Project] Develop a programmer's editor in Java that supports syntax highlighting, compilation support, debugging support, etc.
[Mini-Project] Develop a programmer's editor in Java that supports syntax highlighting, compilation support, debugging support, etc.  Please reply me sir
code
code    how to write this in java
Debugging in jsp? - JSP-Interview Questions
Debugging in jsp?  Hi Friends, am newbie to jsp.How to debug error in jsp
code
code   hi I need help in creating a java code that reminds user on a particular date about their festival. i have no clue of how to do it.. am looking forward to seek help from you
code
code  < comp xlink:type="new" xlink:actuate="onload"/> how to write this in java
Code
Code  how to print this?? with the use of only JSP....... 1 23 456 78910   Here is the jsp number pattern example: 1 2 3 4 5 6 7 8 9 10 <%@page language="java"%> <% int k = 1; for(int i=1; i<= 4 ;i
ILOG Business Rule Studio
-editing and debugging of Java code and rules. Rule Studio supports deploying and debugging rulesets to Rule Execution Server and enables collaboration... integration Auto correction in rule editing Code generation
start debugging problems related to the JDBC API
start debugging problems related to the JDBC API  How do I start debugging problems related to the JDBC API
JAVA code For
JAVA code For   JAVA code For "Traffic signals Identification for vehicles
SmartInspect
; SmartInspect is an advanced .NET logging, Java logging and Delphi logging tool for debugging and monitoring your projects and applications... be distributed royalty-free and we give you the full source code
java code
java code  what is the code to turn off my pc through java program
JAVA CODE
JAVA CODE  JAVA SOURCE CODE TO BLOCK A PARTICULAR WEB SITES(SOCIAL WEB SITE
java code
java code  write a java code to convert hindi to english using arrays
java code
java code  develop a banking system in java
java code
java code  hi any one please tell me the java code to access any link i mean which method of which class is used to open any link in java program
java code
java code  how to extract html tags using java
java code
java code  need java code for chart or graph which compare the performance of aprior algorithm and coherent rule algorithm.plz any one help me out
java code
java code  write a java code for finding a string in partiular position in a delimited text file and replace the word with the values given by user and write the file in new location
java code
java code  sir how to merge the cells in excel using java code please help me and also how to make the text placed in the cell to be center
java code
java code  sir how to merge the cells in excel using java code please help me and also how to make the text placed in the cell to be center
java code
java code  I need the java code that would output the following: HARDWARE ITEMS CODE DESCRIPTION UNIT PRICE K16 Wood screws,brass,20mm $7.75 D24 Wood glue,clear,1 liter $5.50 M93
Java code
Java code   Create a washing machine class with methods as switchOn, acceptClothes, acceptDetergent, switchOff. acceptClothes accepts the noofClothes as argument & returns the noofClothes
java code
java code  what is meaning bufferedreader
java code
java code  what is meaning bufferedreader
java code
java code  I am beginer in java my question is how can i fill data from mysql database to jcombobox using netbeans
Java Code
Java Code  Write a java program, which creates multiple threads. Each thread performs add/delete/update operations on an ArrayList simultaneously
java code
java code  An employee _id consist of 5 digits is stored in a string variable strEmpid. Now Mr.Deb wants to store this Id in Integer type to IntEmpid. write Java statements to do
java code
java code  HOW TO PRINT 1 TO 100 WITHOUT USING CONDITIONAL,ANY LOOP AND ARRAY IN JAVA AND C.URGENT SIR PLZ  Hi, You can use following code: class MyClass { public static void main(String[] args) { int
java code
java code  Write a program to find the difference between sum of the squares and the square of the sums of n numbers
java code
java code   Develop a program that accepts the area of a square and will calculate its perimeter
java code
java code  Create a calculator class which will have methods add, multiply, divide & subtract
java code
java code  input any word ie risk,resul is-- r ri ris risk
java code
java code  Develop the program calculateCylinderVolume., which accepts radius of a cylinder's base disk and its height and computes the volume of the cylinder
java code
java code  Develop the program calculateCylinderArea, which accepts radius of the cylinder's base disk and its height and computes surface area of the cylinder
java code
java code  Create a washing machine class with methods as switchOn, acceptClothes, acceptDetergent, switchOff. acceptClothes accepts the noofClothes as argument & returns the noofClothes
Java code
Java code  Write a program which performs to raise a number to a power and returns the value. Provide a behavior to the program so as to accept any... the following code: import java.util.*; import java.text.*; class NumberProgram
java code
java code  int g() { System.out.println("Inside method g"); int h() { System.out.println("Inside method h"); } } Find the error in the following... cannot define a method inside another method. Anyways, we have modified your code
java code
java code   Develop a program that computes the distance a boat travels across a river, given the width of the river, the boat's speed perpendicular to the river, and the river's speed. Speed is distance/time, and the Pythagorean
java code
java code  Write a program which performs to raise a number to a power and returns the value. Provide a behavior to the program so as to accept any type of numeric values and returns the results
java code
java code  Develop a program that computes the distance a boat travels across a river, given the width of the river, the boat's speed perpendicular to the river, and the river's speed. Speed is distance/time, and the Pythagorean
Java code
Java code  Develop the program calculatePipeArea. It computes the surface area of a pipe, which is an open cylinder. The program accpets three values: the pipes inner radius, its length, and the thickness of its wall
Java code
Java code   Create a calculator class which will have methods add, multiply, divide & subtract   Hi Friend, Try the following code: class Calculation{ public int add(int a,int b){ return a+b
Java code
Java code  An old-style movie theater has a simple profit program. Each customer pays $5 per ticket. Every performance costs the theater $20, plus...; Hi Friend, Try the following code: import java.util.*; import
java code
java code  An old-style movie theater has a simple profit program. Each customer pays $5 per ticket. Every performance costs the theater $20, plus $.50 per attendee. Develop the program calculateTotalProfit that consumes
java code
java code  Develop the program calculateHeight, which computes the height that a rocket reaches in a given amount of time. If the rocket accelerates at a constant rate g, it reaches a speed of g ยท t in t time units and a height
java code
java code  Develop a program that accepts an initial amount of money (called the principal), a simple annual interest rate, and a number of months will compute the balance at the end of that time. Assume that no additional

Ask Questions?

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.