Change the job to the Java pick up again, the language used in the university, although not complicated, there are some strange places. Like static import.
The Static import is a feature introduced in JDK 1.5, but I didn't notice it in college. Its function is to import a static method or a constant. Like what:
Import static java.lang.math.*;
public class HelloWorld {public
static void Main (string[] args) {
System.out.println ("Hello world!");
System.out.println ("Considering a circle with a diameter of 5 cm, it has:");
System.out.println ("A Circumference of" + (Math.PI * 5) + "cm");
System.out.println ("and an area of" + (Math.PI * MATH.POW (2.5,2)) + "sq. cm");
}
After you use the static import, you can write:
Import static java.lang.math.*;
Import static java.lang.System.out;
public class HelloWorld {public
static void Main (string[] args) {
out.println ("Hello world!");
Out.println ("Considering a circle with a diameter of 5 cm, it has:");
Out.println ("A Circumference of" + (PI * 5) + "cm");
Out.println ("and an area of" + (PI * POW (2.5,2)) + "sq. cm");
}
Note "Math." and "System." It can be omitted.
The rules for Static import and import are similar, and the referenced content cannot be ambiguous.
With the static import, the code becomes shorter and more readable, but to some extent it makes it difficult to understand the whole code, because constants and static methods look like global and global methods, a bit of C + +, and lose some of the beauty of OO.