20135127 Tao Junjie Experiment One

Source: Internet
Author: User

Beijing Institute of Electronic Technology (Besti)

the experiment report of Java programming course

class: 201351 name and school number : Tao Junjie 20135127

Instructor : Lou Jia Peng compulsory / elective: elective

Experimental Date: April 16, 2015 time: 18:30 to 20:30

Experimental serial number:(a) results:

Experiment Name: Familiarity with the Java development environment

First, Experimental Content

1. Compiling and running a simple Java program using the JDK

2. Edit, compile, run, and debug Java programs using Eclipse

Second, the experimental requirements

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" 0 points) as well as analysis (what can be learned from it, what gains, lessons, etc.).

3. Report the time of your PSP (Personal software Process)

Step time-consuming percentage

Demand Analysis 10min 8.3%

Design 30min 25%

Code implementation 30min 25%

Test 20min 16.6%

Analysis Summary 30min 25%

4. Copying is strictly prohibited.

Third, experimental knowledge points

1. Installation location and difference of JVM, JRE, JDK;

2. command line run JAVAC,JAVA;JAVAC-CP; JAVA-CP;

3. Path,classpath,sourcepath setting method and application;

4. Package management: package;import;javac-d;

5. Eclipse (Netbeans) manages Java projects, debugging: breakpoints, stepping, etc.;

6. Java basic syntax: type and type conversion; variables; operators; Process control, etc.;

7. Use of JDK help documentation;

Iv. Steps of the experiment

(a) The command line under the Java Program development:

1. Enter the mkdir 20135127 command to establish the experimental directory, note that the directory name must be their own school number (study number to be reflected in the experimental report).

2. Enter the code

3. Enter javac-d. Hello.java command to compile the code, enter the Java Tjj.exp1.Hello command to run the program. The results are as follows:

Note: When you have a package in your code, you must add the-d parameter when you compile your code with JAVAC, and you must prefix the name of the packet when you run the code.

(ii) Development and commissioning of Java programs under Eclipse

1. In Eclipse, click File->New-> Java Project New Java Project:

2. Enter the code:

3. Click the Run button (or use the CTRL+F11 shortcut key) to see the results of the run in the console.

4. Next we practice the debugger, first we open the Debug view by clicking Window->open perspective->debug:

5. The debugger first sets breakpoints and one-step operation. setting breakpoints is easier.

6. Then click the Debug button (or use the F11 shortcut key) to start debugging the Java program, and we can see that the program is stuck on line 4th.

7. Step execution efficiency is slow, if we feel that the 6th line to the 10th line of code is no problem, want to let the program run directly to line 11th, what to do? First we set a breakpoint on line 11th and then click the Resume icon (shortcut F8), and the program runs to line 11th.

8. One-Step execution efficiency is slow also leads to another problem, such as a cycle in the middle of a problem? You can then resolve the issue through conditional breakpoints. When debugging a loop code, there is a value that we pay particular attention to when we look at the value of the variable in the variable tag, such as when we are paying attention to sum at this time, we can see how the sum changes with each step of the execution. To set a conditional breakpoint, we right-click on the left side of line 11th and select Breakpoint Properties ...

(iii) Exercise (through the command line and Eclipse two ways to achieve, their number after the two and the total number of questions and the result of the remainder of the results plus 1 is the number of their own to complete the title, Under Eclipse Practice debugging Program)

On request, 20135127 should complete topic 3.

3. Implement the Fibonacci sequence function and test.

Experiment Code:

Operation Result:

V. Experimental experience (encounter problems and solutions)

1. Unable to open the experimental building, after many attempts still cannot solve, so only in the local experiment.

2. When you run the first program, the compilation error occurs because, in the case of a package, the compilation must strictly follow the javac–d. Xxx.java "format, again compiled note this after a successful resolution.

The purpose of this experiment is to familiarize yourself with the basic instructions of creating folders and viewing files under DOS, as well as the basic usage of familiar with the Java programming tool of Eclipse, to understand the relationships between projects, packages, and classes. and first used the software to write a simple small program. Experience the benefits of the software.

20135127 Tao Junjie Experiment One

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.