Skip to content

Instantly share code, notes, and snippets.

@peterszatmary
Last active December 12, 2016 10:05
Show Gist options
  • Save peterszatmary/e5532a621d8e29d1bbfe580561b22829 to your computer and use it in GitHub Desktop.
Save peterszatmary/e5532a621d8e29d1bbfe580561b22829 to your computer and use it in GitHub Desktop.

JavaInTheory

Static and dynamic binding

  • Static binding happens at compile-time, dynamic binding at runtime.
  • Binding of private, static and final methods always happen at compile time since these methods cannot be overridden. Binding of overridden methods happen at runtime.
  • Java uses static binding for overloaded methods and dynamic binding for overridden methods.

Mix

  • Enum constructor without access modifier specified has private access.
  • Switch clause cannot have null value. Brings NPE.
  • Annotations can have just types : String, another anottations, primitive types, Enums, Class and arrays of types already mentioned.
  • ThreadLocal enables you to create variables that can only be read and written by the same thread. usages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment