public class Test { public static void main(String[] args) { // TODO Auto-generated method stub say(); Test.say(); //Cannot use this in a static context //如果写成this.say(), 是错误的, } public static void say(){ System.out.println("大家好"); } } 调用静态方法是不能用this关键字的。直接使用类名就可以了。