Java Experiment 120,135,104 Liu Shuai

Source: Internet
Author: User

Lab Report

First, the purpose and requirements of the experiment:

Experimental Purpose:

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

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

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, the problem encountered (tool find, install, use, program editing, debugging, running, etc.), solution analysis (from which can get what revelation, what harvest, lessons, etc.).

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

Second, the experimental principle, content

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;

Third, the operation result:

For the exercises that have given the demonstration process, 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.

According to the teacher's request, I should do the fifth question, namely seeks 1~n between all indexes, because of network reason, part process completes in this machine, the experiment process and the result are as follows:

This is the result of the operation on Eclipse:

This is the result of the JDK run:

This is the debug result: (Double click to create breakpoint on left side)

The process can be summed up in the following points:

Breakpoint Settings: Breakpoint Properties

Try to use shortcut keys to debug programs more efficiently

Debugging process: Setting breakpoints

Window->open Perspective->debug

Right-click Toggle Breakpoint

Debugging process: Single Step operation

PSP (Personal software Process) time

Steps

Take

Percentage

Demand analysis

30min

30%

Design

10min

10%

Code implementation

40min

40%

Test

20min

20%

Analysis Summary

From my PSP schedule can be found that most of my time is used in the requirements analysis and code implementation, to get the topic read the question for me to take a long time, and my basic skills are not solid, coding will be slower

Iv. problems encountered and their solutions

In this experiment, the first problem encountered is not know how to use the virtual machine, and later in the experimental building to watch the tutorial only to know that the virtual desktop can be displayed full screen, with JAVAC-CP; running the JDK in the virtual machine

The second problem encountered is that you do not know how to enter it, and find an exercise that you have previously done in Java class to know that you can use import java.io. Scanner SC = null; sc = New Scanner (System. inch ); make input

The third problem is that I don't know how to set breakpoints in my Chinese version of Eclipse, because I can't find breakpoint, and then I accidentally double-clicked the left two of the lines, and found that I could set breakpoints with this peculiar method, and learned some debugging related knowledge, such as

Breakpoint Settings: Breakpoint Properties

Try to use shortcut keys to debug programs more efficiently

Debugging process: Setting breakpoints

Window->open Perspective->debug

Right-click Toggle Breakpoint

Debugging process: Single Step operation

Java Experiment 120,135,104 Liu Shuai

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.