Java`s Reserved Words

when you are writing java code, you should know that java reserves certain words for itself as part of the java language. There aren`t too many of them, though. Here they are;

  • abstract – It specifies that the class or method will be implemented later, in a subclass.
  • boolean – A data type that can hold true and false values only.
  • break – A control statement for breaking out of loops.
  • byte – A data type that can hold 8-bit data types.
  • byvalue – It is resetrved for future use.
  • case – It is used in switch statement to mark blocks of text.
  • cast – It is reserved for future use.
  • catch – It catches exceptions generated by try statement.
  • class – It declares a new class.
  • char – A data types that can hold unsigned 16-bit unicode characters.
  • const – It is reserved for future use.
  • continue – It sends control pack outside a loop.
  • default – It specifies the default block of code in a switch statement.
  • do – It starts do-while loop.
  • double – A data type that can hold 64-bit floating-point value.
  • else – It indicates alternative branches in an if statement.
  • extends – It indicates that a class is derived from another class or an interface is derived from another interfaces.
  • final – It indicates that a variable holds a constant value or that a method will not be overridden.
  • finally – It indicates a block of code in a try-catch structure that will always be executed.
  • float – A data type that holds a 32-bit floating-point value.
  • for – It is used to start a for loop.
  • future – it is reserved for future use.
  • generic – it is reserved for future use.
  • goto – it is reserved for future use.
  • if – It tests a true/false expression and branches accordingly.
  • implements – it specifies that a class implements an interfaces.
  • import – it references other class.
  • inner – it reserved for future use.
  • instanceof – it indicates whether an objects is an instance of a specific class or implements a specific interface.
  • int – A data type that hold a 32-bit signed integer.
  • interface – it declare an interfaces.
  • long – A data types that holds a 64-bit integer.
  • native – it specifies that a method is implemented with native code.
  • new – it creates new objects.
  • null – it indicates that a reference does not refer to anything.
  • operator – it is reserved for future use.
  • outer – it is reserved for future use.
  • packages – it declares a java package.
  • private – An access specifier indicating that a method or variable may be accessed only in the class it`s declared in
  • protected – An access specifier indicating that a method or variable may only be accessed in the class it`s declared in
  • public – An access specifier used for classes, interfaces, methods, and variable indicating that an item is accessible throughout the application
  • rest – it is reserved for future use.
  • return – it sends control and possibly a return value back from a called method.
  • short – A data types that can hold a 16-bit integer.
  • static – it indicates that a variable or method is a class method
  • superĀ  – it refers to a class`s base class
  • switch – A statement that executes code based on a test value.
  • this – it refers to the current object in a method or constructor.
  • synchronized – it specifies critical sections or methods in multithreaded code.
  • throw – it creates an exception.
  • throws – it indicates what exception.
  • transient – it specifies that a variable is not part of an object`s persistent state.
  • try – it starts a block of code that will be tested for exceptions.
  • var – it is reserved for future use.
  • void – it specifies that a method does not have a return value.
  • volatile – it includes that a variable may change asynchronously.
  • while – it starts a while loop.