Java Lab Report One

Source: Internet
Author: User

Beijing Institute of Electronic Technology (BESTI)

Real Inspection report

Course: Java Lab class: 1351 name Chen Min No.: 20135124

Score: Instructor: Lou Jia Peng Experimental Date: 2015.4.15

Experiment level: Preview degree: Experiment time:

Instrument Group: 03 Compulsory/Elective: Compulsory experiment serial number: 01

Lab Name: familiarity with Java program development Environment

Experimental purposes and requirements:1. Implementation of the command line Java program Development ;

2. implementing Java program Development under Eclipse

Experimental instrument:

Name

Model

Number

Eclipse

1

Virtual machines

1

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; flow control etc; 7. The use of the JDK help documentation.

Experimental steps:

(i) Java program Development under command line

1. Enter the CD 20135124 command into the experimental directory, and then enter a similar mkdir EXP1 to establish the first experimental directory, and then enter the CD EXP1 into the experimental directory, you can enter the PWD command to view the current working path

2. Enter the cd Code command into code (note C to capitalize) directory

1, the first line of code, which affects how we compile the code using JAVAC.

2, the second line of code, when we use a class in the Java class Library, to import the relevant classes with import, the import path can view the JDK Help document, for example, we use the Scanner class:

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.

Two Under Eclipse Java program development, debugging:

Enter the eclipse command on the command line and enter or click the Eclipse EE icon on the desktop to open eclipse

In Eclipse, click File->new-> Java Project to create new Java projects

Enter the project name Hellojdb and click the Finish button to complete the new project,

In Eclipse, click File->new->class to create a new Java class

Enter the package name LJP according to the Java code specification, the class name Hellojdb, and tick the Automatically generate main function option, then click the Finish button

To practice the Debug program:

First open debug view with Window->open Perspective->debug

The debugger first sets breakpoints and runs in one step.

Then click the Debug button to start debugging the Java program

(c) Practice

Question Fifth:

Now I'm looking for the function of all prime numbers between positive integers 1-n and debugging

JDK Help documentation uses

Java Lab Report 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.