天天看点

java类的静态方法注意项

例如:

public class 测试 {
    public static void main(String[] args) {
        a a = new a();//new的是,即已经调用了构造无参的方法!
        a.ff();
    }
}      
class a{
    public static void ff(){
        System.out.println("a类中ff方法被调用");
    }
}