package Dome;
import static java.lang.Math.random;
import static java.lang.Math.PI;
?
public class Test {
public static void main(String[] args) {
System.out.println(random());
System.out.println(PI);
}
}
package Dome;
?
public class Person {
{//付初始值
System.out.println("匿名方法快");
}
static {//静态方法只执行一次
System.out.println("构造方法快");
}
?
public Person() {
System.out.println("无参构造");
}
?
public static void main(String[] args) {
Person s1 = new Person();
System.out.println("=======");
Person s2 = new Person();
?
?
}
}
package Dome;
?
public class Dome07 {
public static int age;//静态方法
public double score;//非静态方法
?
public static void main(String[] args) {
Dome07 s1 = new Dome07();
System.out.println(Dome07.age);
System.out.println(s1.age);
System.out.println(s1.score);
new Dome07().run();
}
public static void go(){
?
}
public void run(){
?
}
?
?
?
}
+++