List of Java Keywords
Java keywords are reserved words that have predefined meaning in java. They are total 51 keywords in java, but I have mentioned only few-
Here is a list of keywords in the java programming language.
Modifiers can be categorized in two categories, access modifiers and non-access modifiers:
1. Access modifiers
2. Non-access modifiers
Static keyword is used with variables and methods; it is mainly used to make your programs memory efficient.
When we declare static variable, then classes maintain one copy of class variables regardless of how many instances exist of that class.
Static can also be used to define a method as class method. Class methods are invoked by the class instead of a specific instance, and can only operate on class variable.
Static method does not require object to call the method.
Static field - Another name of class variable.
Static method - Another name of class method.
A keyword used in class definition to specify that a class is not be instantiated, but rather be inherited by other classes.
An abstract class can have abstract and non abstract methods that are not implemented in the abstract class, but in subclass.>
Abstract methods are undefined methods i.e. methods without body, there is no implementation details of abstract methods.>
Non-abstract methods are defined methods i.e. methods with body.
Final keyword is used to restrict the functionality of the variable, class and method.
Final variable- If we declare any variable as final, then it will not be change i.e. constant.
Final method- I we declare any method as final, then it will not be override.
Final class-If any class will be declaring as final class than that class can’t be inherited.
A keyword in Java programming language that, when applied to a method or code block, guarantees that at most one thread at a time executes the code.
new keyword in java is used to dynamic allocates memory for an object returns a reference to object and binds the reference with the object. Here reference to object means address of object. So it is essential in java that all the objects must be dynamically allocated.
A java keyword that can be used to represent an instance of the class in which it appears(i.e. current class). this can be used to access class variables and methods.
A java keyword used to access members of a class inherited by the class in which it appears.