I. Experimental content 1. Compile and run a simple Java program using the JDK; 2. Use Eclipse to edit, compile, run, and debug Java programs. Second, the experimental requirements 1. Students who do not have a Linux base are advised to first learn about the Linux Basic Primer (new version), Vim Editor course; 2. Complete the experiment and write the experiment Report 3. Report on your PSP (Personal software Process) Time:
| step |
time consuming |
percent |
| demand analysis |
30min |
15% |
| design |
30MIN  |
15% |
| code implementation |
60MIN  |
45% |
| test |
30min |
15% |
| Analysis summary |
20min |
10% |
4. Copying is strictly prohibited. Third, the experimental knowledge point 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. Iv. Steps of the experiment
1, using the JDK to run a simple Java program (because the first time did not finish, the next is insufficient resources can no longer enter the experimental building, so still to complete)
2. Java program development and debugging under Eclipese
3, exercise (through the command line and eclipse two methods to implement the Fibonacci sequence function, and test)
Package experiment;
Import Java.util.Scanner;
public class Fibonacci
{
public void Getfibonacci (int number)
{
int a = 0;
int b = 1;
System.out.print (b);
for (int i = 0; i < number; i++)
{
int sum = a + b;
System.out.print ("" + sum);
A = b;
b = sum;
}
}
public static void Main (string[] args)
{
System.out.println ("Please enter a number:");
Scanner x1 = new Scanner (system.in);
int x = X1.nextint ();
New Fibonacci (). Getfibonacci (x);
}
}
Five, the Experiment experience
When doing exercises, the code that starts writing can only implement the first 20 digits of the output, and it feels less complete, then inserts the code that the keyboard enters and displays, implements the input of a number x, and outputs the first X-digit sequence.
System.out.println ("Please enter a number:"); Scanner x1 = new Scanner (system.in); int x = X1.nextint ();
That is, prompted to enter a number, the keyboard input, the value for the number of subsequent output sequence, the realization of the number of people to control the output sequence, making the experiment more complete.
The breakpoint is not set at the beginning, and the last look at the figure is set on the line instead of in file. I feel the details of the training is my biggest harvest of this experiment, a little bit of error can lead to the failure of the experiment, and in the code, in the beginning to think well what they want to achieve, and what functions, so in the writing process will play a multiplier effect, and the rigor of thinking is also a training.
Java learning is the most important experiment, textbook what is only auxiliary, will learn the flexible use, and can not make others give me a thought I know how to do, someone else's code I can read, this is not enough, give a request can experiment, complete the code to write out this is the purpose of learning Java, In the writing process encountered problems themselves to go through a variety of channels to solve, this is the fun of writing. My C language is very rotten do not want to mix the days again, although the code is very simple experiment, but still some baffled me, the computer did not power after lying in bed on the phone to find a solution, until the rest of the sleep, this feeling is exhausted filled with the feeling of fullness, the joy of the harvest, independent completion of the enrichment.
Java First Experiment