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:

    The kind of power mothers have is enormous. Take the skyline of Istanbul—enormous breasts, pathetic little willies, a final revenge on Islam. I was so scared I had to crouch in the bottom of the boat when I saw it.
    Angela Carter (1940–1992)

    There are four classes of idols which beset men’s minds. To these for distinction’s sake I have assigned names—calling the first class Idols of the Tribe; the second, Idols of the Cave; the third, Idols of the Market-Place; the fourth, Idols of the Theatre.
    Francis Bacon (1561–1626)