Created
March 24, 2015 16:13
-
-
Save chrisyeung1121/e788203a97d1fe02458e to your computer and use it in GitHub Desktop.
Java's final variable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://javarevisited.blogspot.hk/2011/12/final-variable-method-class-java.html | |
// Final variable | |
final int CONSTANT_PI = 3.14; // Note constant are usually defined in ALL CAPS | |
CONSTANT_PI = 2.14; // will cause compilation error | |
// final method | |
// final method cannot be overriden by subclass | |
// final Class | |
// .. check link above to read more. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment