&¡The "5-Minute" CCEE Survival Sheet1.
The Variable & Static Binding (Quick-Look)Member
TypeBindingFollows...Instance MethodDynamicThe Object (new Child())Static
MethodStaticThe Reference (Parent p)Variables (All)StaticThe Reference (Parent p)CCEE
Trap: If you see Base b = new Derived(); [Link](b.x); $\rightarrow$ Look at Base
class for x.2. The "Short/Byte" Arithmetic Ruleb = b + 1; $\rightarrow$ FAIL (Result is int,
cannot go back to byte).b += 1; $\rightarrow$ PASS (Implicit cast: b = (byte)(b+1)).b =
(byte)128; $\rightarrow$ Results in -128 (Overflow wrap-around).3. Equality & The PoolInteger
a=127, b=127; $\rightarrow$ a == b is TRUE (Cached).Integer a=128, b=128; $\rightarrow$ a
== b is FALSE (Not cached).[Link](StringBuilder) $\rightarrow$ ALWAYS FALSE
(Different classes).[Link]() == "literal" $\rightarrow$ TRUE (Points to pool).4. Overriding
"Illegal" MovesVisibility: You cannot make it more private. (Parent public $\rightarrow$ Child
protected = FAIL).Exceptions: Child cannot throw a broader checked exception. (Parent
IOException $\rightarrow$ Child Exception = FAIL).Static: You cannot override static with
instance (and vice versa) = [Link]: You cannot override a private method. The child
version is just a new, unrelated method.5. Constructor & Init FlowStatic Blocks (once,
top-to-bottom).Parent Constructor (super() always first).Child Instance Blocks/[Link]
Constructor [Link] Trap: If Parent has Parent(int x) and no Parent(), Child must write
super(10); or it won't compile.6. The "Silly Mistake" ScannerScan the code snippet for these
three things before answering:Assignment in if: if (i = 10) is an error (should be ==).Missing
Semicolon/Braces: Check the main method signature (String[] args is correct).Null Reference:
Test t = null; [Link](); $\rightarrow$ This works! (Static doesn't need an object).
Generated with [Link]