Java also has a “default” access, which comes into play if you don’t use one of the aforementioned specifiers. This is usually called package access because classes can access the members of other classes in the same package (library component), but outside of the package those same members appear to be private.The “wrapper” classes for the primitive data types allow you to make a non-primitive object on the heap to represent that primitive type.
java.lang is implicitly included in every Java code file
constructor 內部可能通過this 調用其它construcotr,但在成員函數內不能用this調用constructorfinalize()在什麼時候被調用?有三種情況1.所有對象被Garbage Collection時自動調用,比如運行System.gc()的時候.2.程式退出時為每個對象調用一次finalize方法。3.顯式的調用finalize方法除此以外,正常情況下,當某個對象被系統收集為無用資訊的時候,finalize()將被自動調用,但是jvm不保證finalize()一定被調用,也就是說,finalize()的調用是不確定的,這也就是為什麼sun不提倡使用finalize()的原因because they are in the same directory and have no explicit package name. Java treats files like this as implicitly part of the “default package” for that directory, and thus they provide package access to all the other files in that directory.protected also gives package access—that is, other classes in the same package may access protected elementsThe actual process of initialization is:1.The storage allocated for the object is initialized to binary zero before anything else happens.2.The base-class constructors are called as described previously. At this point, the overridden draw( ) method is called (yes, before the RoundGlyph constructor is called), which discovers a radius value of zero, due to Step 1.3.Member initializers are called in the order of declaration.4.The body of the derived-class constructor is called.
@Override
When you mean to override a method, you can choose to add this annotation and the compiler will produce an error message if you accidentally overload instead of overriding