Extends
在一个method里面调用另外一个method,如果这个被调用的method的对象如果是class外部的一个变量,则不用xxx.xxx,如果是class内部的一个变量,则需要xxx.xxx
在子构造器被构造时,父构造器会先被调用。
eg:
public vengefulSLList() {
super();
deletedItems = new SLList<Blorp>();
这个super表明显性的创造构造器,如果不要super即隐形地创造构造器,因为java会自动创造构造器。所以在这种情况下加不加都没有区别。但是如果是这种情况:
public vengefulSLList(Blorp x) {
super(Blorp x);
deletedItems = new SLList<Blorp>();
如果有super,他就可以调用正确的super构造器SLList(x),如果没有,他就会调用错误的SLList()。
如果有overriden则进行动态选择,如果没有overriden则选择静态选择
当assignment时,左边的static type需要is a 右边的static type.
inheritance:
subclasses必须inherit所有的methods from superclasses
The difference between compile time and runtime compile
Compile time is the period when the programming code (such as C#, Java, C, Python) is converted to the machine code (i.e. binary code). Runtime is the period of time when a program is running and generally occurs after compile time.