summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorZachary Ferguson <zfergus2@users.noreply.github.com>2015-10-06 19:07:24 -0400
committerZachary Ferguson <zfergus2@users.noreply.github.com>2015-10-06 19:07:24 -0400
commit420e04a5909ae309683201c9fb272ed3dc142283 (patch)
tree72747a4f08dbbd3317d05c83a4921ed61d2a06d4
parent01685afb8429f1b9756e97d6116ab7cbf24ce6c0 (diff)
[java/en] Final Methods
Explained Final Methods
-rw-r--r--java.html.markdown15
1 files changed, 14 insertions, 1 deletions
diff --git a/java.html.markdown b/java.html.markdown
index 6bfa6633..9ab257a4 100644
--- a/java.html.markdown
+++ b/java.html.markdown
@@ -406,7 +406,7 @@ class Bicycle {
this.name = name;
}
- // Function Syntax:
+ // Method Syntax:
// <public/private/protected> <return type> <function name>(<args>)
// Java classes often implement getters and setters for their fields
@@ -604,6 +604,19 @@ public final class SaberToothedCat extends Animal
}
}
+// Final Methods
+public abstract class Mammal()
+{
+ // Final Method Syntax:
+ // <access modifier> final <return type> <function name>(<args>)
+
+ // Final methods, like, final classes cannot be overridden by a child class,
+ // and are therefore the final implementation of the method.
+ public final boolean isWarmBlooded()
+ {
+ return true;
+ }
+}
```
## Further Reading