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:

    A poem is like a person. Though it has a family tree, it is important not because of its ancestors but because of its individuality. The poem, like any human being, is something more than its most complete analysis. Like any human being, it gives a sense of unified individuality which no summary of its qualities can reproduce; and at the same time a sense of variety which is beyond satisfactory final analysis.
    Donald Stauffer (b. 1930)

    Is a man too strong and fierce for society, and by temper and position a bad citizen,—a morose ruffian, with a dash of the pirate in him;Mnature sends him a troop of pretty sons and daughters, who are getting along in the dame’s classes at the village school, and love and fear for them smooths his grim scowl to courtesy. Thus she contrives to intenerate the granite and the feldspar, takes the boar out and puts the lamb in, and keeps her balance true.
    Ralph Waldo Emerson (1803–1882)