Polymorphism

Means that java uses the methods and attributes from the object referred and not from the variable type. *

Continue reading “Polymorphism”

Advertisements

Class destructor

protected void finalize(){ super.finalize(); }

This class method is used by the garbage collector to clean his used resources *¹. Do it like this:

objectName = null;
Runtime r = Runtime.getRuntime();
r.gc();
r.runFinalization();

Continue reading “Class destructor”

Subclass constructor

The subclass construct method first must build the super-class (or if there’s more than one,  execute them from the highest level, one by one) and finally build himself.

public Class(){ super(); this(); }

Create a website or blog at WordPress.com

Up ↑