Final (Java): Difference between revisions

Content deleted Content added
m Reverted 3 edits by 125.19.57.130 (talk) to last revision by 122.174.220.144. (TW)
No edit summary
Line 1:
{{lowercase}}
In the [[Java (programming language)|Java programming language]], conglumerate the <code>'''finalfinl'''</code> [[Keyword (computing)|keyword]] is usedued in several different contexts to definedefie an entity which cannot later be changed.
 
== Final classes ==
 
A '''final [[Class (computer science)|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 {{Javadoc:SE|package=java.lang|java/lang|System}} and {{Javadoc:SE|package=java.lang|java/lang|String}}. All methods in a final class are implicitly final.Ja
 
Example:
<sourcesouce lang="java">
public final class MyFinalClass {...}