8月8日学习日志
1.今天学习了java中的动态绑定,动态绑定具体表现在向上转型上,因为只有在运行时才知道具体运行的是哪个实例。
示例:
public class Father{
public void say(){
System.out.println("father say()");
}
public static void main(String[] args){
Father son=new Son();
son.say();
}
}
class Son extends Father{
public void say(){
System.out.println("son say()");
}
}
2.对多态不够熟练掌握,以后会多加练习。
3.明天计划学习static关键字。

浙公网安备 33010602011771号