20169204,exp1:Familiar with the Java development environment(Linux+IDEA)

20169204 exp1:

Experimental content and steps

  • Use JDK to compile and run a simple Java program

Run the virtual machine, open the linux system;
Go to the code cloud home page and clone your own project. git clone https://git.oschina.net/md2017/GoldDog20169204.git

Enter the project directory using the command to create the folder exp1,

  • mkdir exp1
    Enter the folder after the establishment of .java file,write the program. Compile and run:
  • cd exp1
  • gredit Hello.java

20169204,exp1:Familiar with the Java development environment(Linux+IDEA)_第1张图片

20169204,exp1:Familiar with the Java development environment(Linux+IDEA)_第2张图片

Use IDEA to edit, compile, run, debug Java programs:

  • Open the IDEA, creat a project and write the program

20169204,exp1:Familiar with the Java development environment(Linux+IDEA)_第3张图片

20169204,exp1:Familiar with the Java development environment(Linux+IDEA)_第4张图片

compire and run it, the result is:

20169204,exp1:Familiar with the Java development environment(Linux+IDEA)_第5张图片

Exercise 5: To achieve the correct integer 1-N between all the prime number of the function, and test.

  • experiment procedure
    At first , we order N = 100.
    Code:

20169204,exp1:Familiar with the Java development environment(Linux+IDEA)_第6张图片

operation result:
20169204,exp1:Familiar with the Java development environment(Linux+IDEA)_第7张图片

If you need to enter a natural number to output prime numbers, see the following code:

20169204,exp1:Familiar with the Java development environment(Linux+IDEA)_第8张图片

Problem and Solution in the experiment

How do I re-include a class into the build path in Intellij IDEA?

  • Deal

EDIT: Figured it out myself. Go to Settings>Project Settings>Compiler>Excludes and delete the entry

Code hosting

Experimental summary

step time consuming percentage
Demand Analysis 20 15
Design 30 3/4
Code 60 3/4
Test 10 4/6
Analyzed 30 6/6

你可能感兴趣的:(20169204,exp1:Familiar with the Java development environment(Linux+IDEA))