Skip to content

keywords

Keyhan Hadjari edited this page Sep 3, 2016 · 3 revisions
  • volatile: like synchronized but for variables and only for reading (lazy read), indicates that a thread must reconcile its working copy of the field with the master copy every time it accesses the variable. If volatile is not used then you cannot be sure that the value is read is the current value, could be cached.
  • native: Implemented in another language like C++ (JNI)
  • interface
  • new
  • continue: jump to beginning of the next iteration of the loop (not for if statements, just for loops)
  • break: Break out of the loop (just for loops)
  • private: makes a member accessible only from within its own class
  • protected: makes a member accessible only to classes in the same package or subclass of the class
  • public: means that all other classes regardless of the package that they belong to, can access the member (assuming the class itself is visible) default access (no privacy keyword chosen) makes a member accessible only to classes in the same package.
  • final: makes it impossible to extend a class, when applied to a method it prevents a method from being overridden in a subclass, when applied to a variable it makes it impossible to re-initialize a variable once it has been initialised
  • abstract: declares a method that has not been implemented.
  • transient: indicates that a variable is not part of the persistent state of an object. It is not included in serialization of the object.
  • static: Used to declare a field, method, or inner class as a class field. Classes maintain one copy of class fields regardless of how many instances exist of that class. static also is used to define a method as a class method. Class methods are bound to the class instead of to a specific instance, and can only operate on class fields. (Classes and interfaces declared as static members of another class or interface are actually top-level classes and are not inner classes.)
  • friend: Is not a keyword

Clone this wiki locally