1、Method:
Object-oriented programming is often summarized as simply "sending messages to objects"
2、byte:
The size of each of char in a String is 16 bit, or two bytes,to support Unicode characters;
3、OverLoading with primitives
A primitive can be automatically promoted from a smaller type to a larger one;example:
f(long l){},f(float f){},f(double d){} execute: int a=0; f(a); It will be call f(long l) method;
char produces a slightly different effect,since if it doesn't find a exact char match, it is promoted to int;
others: f(long l) {},f(folat f){} execute: double d=0; f(d)--->error ,f((long)d) and f((float)d) are right;
4、You simply use new to create the elements in the arrary;
int [] a; int [] b = new int[10];
5、Non-static instance initialzation ;
public Class A {
private int a;
{
a = 10;
}
}
This syntax is necessary to support the initialization of anonymous inner calsses;
6、final and private
Any private methods in a class are implicitly final ,Because you can't access a private method, you can't override it.
This issue can confusion ,because if you try to override a private method, its seems to work, and the complier doesn't give an error message;
"Overriding" can only occur if something is part of the base=class interface. That is , you must be able to upcast an object to its base type and call the same method ;
7、late binding
All method binding in Java uses late binding unless the method is static or final(private methods are implicitly final)
8、初始化类,先初始化父类,触发父类初始化的方式不是在子类的构造函数中;