20165235 experiment a Java development environment familiarity one, experimental content and step experiment a Java development environment familiarity-1
- Set up the 20165235exp1 folder, enter the folder after the SRC, bin folder.
- Write code using VIM.
- Compile the code and run the code.
Experiment a Java development environment familiarity-2
- opens Ieda and creates the project with the project name
hellojdb
. Then, after the method sets a breakpoint, run
stops at the breakpoint.
- sets a breakpoint in the loop structure and presses
F9
to stop at the breakpoint.
- Set conditional breakpoint,
i==50
, F9, run.
- Settings
Remove once hit
runs through the loop body at once. The
-
Prints the value after it finishes.
Experiment a Java development environment familiarity 3
-
- Determine whether a number is a palindrome number, enter from the command line, and test (normal, abnormal, boundary condition).
- first writes the code and debugs it in Ieda. You first set a breakpoint in the method, and then, in the loop structure
count++
, place a breakpoint, and each step executes F7
to print the value of count.
- Debug with jdb at the command line after debugging in Ieda, with complete code. Palindrome number is to ensure that the number of symmetrical, arbitrary number can be stored in the array, and its status and high-level comparison, if not the same jump out of the loop, and implement the statement
flag=1
.
- Run result diagram: Normal (enter a number less than 10 digits), exception (input is not a number), boundary condition (the number entered is greater than or equal to 10 digits).
-
This is debug under Jdb
Second, problems encountered during the experiment When debugging with Jdb, I used the Scanner class system.in, unable to enter the value to n when debugging, input the value in the console, will error "* * Unrecognized ", with the last recursive debugging method also cannot enter a value. The internet search has not found the right way.
Three, experimental experience and summary The content of this experiment is relatively simple, the first use of Ieda will also appear many errors, in the continuous learning will be more fruitful. The use of Ieda is easier for beginners than for JDB debugging.
Steps |
Time Consuming |
percentage |
Demand analysis |
3min |
7% |
Design |
5min |
12% |
Code implementation |
20 |
50% |
Test |
3 |
7% |
Analysis Summary |
10 |
24% |
20165235 experiment a familiarity with the Java development environment