20165233 experiment a familiarity with the Java development environment

Source: Internet
Author: User
Tags greatest common divisor

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
    • Normal situation

    • Boundary conditions

Lower border

Upper border

    • Abnormal conditions

Realized through idea
    • Normal situation

    • Boundary conditions

    • Abnormal conditions

    • Breakpoint Debugging

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.