20165233 experiment a familiar test requirement for a Java development environment
1. Students who do not have a Linux base are advised to start with the Linux basics (new version) Vim Editor course;
2. Complete the experiment, write the experiment Report, the experiment Report template see QQ Group, pay attention to the experiment report focus is the running result, encounter problem (tool find, install, use, program edit, Debug, run, etc.), solution (empty method such as "Check Network", "Ask classmate", "read book" Equal to 0 points) and analysis (from which can get what revelation, what harvest, lessons, etc.);
3. In the lab report, Count your PSP (Personal software Process) Time:
Steps |
Take |
Percentage |
Demand analysis |
5min |
8.3% |
Design |
15min |
25% |
Code implementation |
30min |
50% |
Test |
5min |
8.3% |
Analysis Summary |
5min |
8.3% |
4. Copying is strictly prohibited.
Experimental content:
1. Compile and run a simple Java program using the JDK;
2. Use idea to edit, compile, run, and debug Java programs.
Experiment Step experiment A familiar Java development environment-1
- Set up an experimental catalogue with your own study number.
- Edit the code with vim Hello.java.
- Compile and run the Hello.java code.
Experiment a Java development environment familiarity-2
- New Hellojdb Class
- Single-step debugging, setting breakpoints
- Set conditional breakpoints
Experiment a Java development environment familiarity-3
Practice Title: Achieve the function of two number greatest common divisor and least common multiple, enter from the command line, and test (normal, abnormal, boundary condition).
Implemented through the command line
Lower border
Upper border
Realized through idea
Problems encountered in the experiment
- I run with the idea run from the command line to get a different "exceptional case" run result. For example: I input-61 and-8, because I designed in the program "if the input value is less than 0 will be the maximum common factor and the value of least common multiple return-1", so in idea, will be the
(-61,-8)=-1
[-61,-8]=-1
result of, and in the terminal will be returned as the result:
Workaround: The error that occurs after the program is run is the result of a Exception in thread "main" java.lang.StackOverflowError
memory overflow in the Java stack. This memory overflow description, the Java stack settings are too small, we can use -Xss
this parameter to simulate this exception, -Xss
is used to set the size of the stack.
Analysis: This is the first time to encounter such problems, but the use -Xss
is to set the size of the stack, is to be based on the computer to modify, it is possible to change the larger bug, so try to use idea to run, to the program's inclusiveness also need to pay more attention to, think of writing a more comprehensive program.
20165233 experiment a familiarity with the Java development environment