Skip to content

Instantly share code, notes, and snippets.

@chrisyeung1121
Created March 24, 2015 16:13
Show Gist options
  • Save chrisyeung1121/e788203a97d1fe02458e to your computer and use it in GitHub Desktop.
Save chrisyeung1121/e788203a97d1fe02458e to your computer and use it in GitHub Desktop.
Java's final variable
// 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