Final (Java) - Final Classes

Final Classes

A final class cannot be subclassed. This is done for reasons of security and efficiency. Accordingly, many of the Java standard library classes are final, for example java.lang.System and java.lang.String. All methods in a final class are implicitly final.

Example:

public final class MyFinalClass {...} public class ThisIsWrong extends MyFinalClass {...} // forbidden

Restricted subclasses are often referred to as "soft final" classes.

Read more about this topic:  Final (Java)

Famous quotes containing the words final and/or classes:

    “Decisive inventions and discoveries always are initiated by an intellectual or moral stimulus as their actual motivating force, but, usually, the final impetus to human action is given by material impulses ... merchants stood as a driving force behind the heroes of the age of discovery; this first heroic impulse to conquer the world emanated from very mortal forces—in the beginning, there was spice.”
    —Stefan Zweig (18811942)

    “Genocide begins, however improbably, in the conviction that classes of biological distinction indisputably sanction social and political discrimination.”
    —Andrea Dworkin (b. 1946)