System是个类,而out则是他的成员变量,println倒真的是方法名了。
记住接口和抽象类里都可以有静态的成员变量,但是接口里面不能有普通的成员变量,但是你可以定义为final常量的成员变量,也就是他们都可以有成员变量。
浏览器根据Header里面的Encoding参数来确定编码的方式
假定Base b = new Derived(); 调用执行b.methodOne()后,输出结果是什么?
public class Base
{
public void methodOne()
{
System.out.print("A");
methodTwo();
}
public void methodTwo()
{
System.out.print("B");
}
}
public class Derived extends Base
{
public void methodOne()
{
super.methodOne();
System.out.print("C");
}
public void methodTwo()
{
super.methodTwo();
System.out.print("D");
}
}
记住只要不是被super调用的,且子类有重写的方法,那么就一定是调用子类的方法,哪怕你进入倒了父类里面,可以看下图的解析。