From 420e04a5909ae309683201c9fb272ed3dc142283 Mon Sep 17 00:00:00 2001 From: Zachary Ferguson Date: Tue, 6 Oct 2015 19:07:24 -0400 Subject: [java/en] Final Methods Explained Final Methods --- java.html.markdown | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'java.html.markdown') 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: // () // 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: + // final () + + // 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 -- cgit v1.2.3