Summarize the knowledge points according to the first and second questions of the experiment as follows:
when using classes in a Java class library, import the related classes with import
when there is a package in the code, you must add the- d parameter when you compile the code with Javac , and add the name prefix when you run the code .
Third, run shortcut key: ctrl+f11
Iv. Window->Open Perspective->Debug Opening the debug view
Five, set breakpoints: Shift+ctrl+b
Six, single-step operation there are two: Step Into (Fast F5) and step Over (fast F5) in the actual use of our first use Step Over , only the function execution error, indicating that the program problem in the called function, then come back through Step Into Enter the function to debug.
Seven, click the Resume icon (shortcut key F8 ), the program runs to the following line
Experimental Content : Achieve student performance management function, and test
Experimental Process :
Operation Result:
(The first and second questions in the experimental building, this blog only put the experiment of the third problem of the exercise)
Problems encountered and solutions:
1. I do not know how to enter and input data. Solution: Use import Java.util.Scanner according to the first example of experiment; Scanner is similar to the scanf in C language.
2. Do not know how to achieve the ranking in Java function. Solution: Refer to the C Language Student performance management system, using the TEMP intermediate variable loop to judge.
3. Forget how to print out the student's name, course score, total score, average score and rank in the form of a table. Workaround: Use the tab \ T, similar to the C language
Experiment Harvest :
The most important benefit of this experiment is how to complete the input and data entry in Java. Starting from a freshman programming has always been my weak spot, feeling that girls and boys, compared to the interest of the code is too much. Freshman C language is often weak, the foundation is weaker than the boys, so I hope this semester to learn Java can make up for this regret. This Java experiment I mainly refer to the C language secondary school performance management system to the Java version of the student performance management system, the main need to modify the part of the definition of input data, plus packages and classes. I hope to be able to gradually skillfully use the Java language in future study.
A lab report on Java experiments