Java Keywords List and Definitions PDF Download

Hello Friends, In this Article, Java Keywords list and Definitions PDF, we will see the list of all the Java Keywords along with their definitions, and you can also download the PDF at the end of the article.

Java Keywords Lists and Definitons PDF
Java Keywords list and Definitons PDF

What is Java Keyword?

Java Keyword is one of the 50 reserved words or fixed terms that have predefined meanings and are used for specific purposes in the Java Programming Language. It means we cannot use these reserved words for purposes other than what they are meant for.

Their meaning is already defined and fixed in the compiler for performing some specific task, which means they cannot be used as identifiers. Also, you cannot use them as names for variables, classes, subclasses, interfaces, enums, methods, or objects.

There are 50 keywords in the Java Programming Language but only 48 are used. Two keywords goto and const are not used in the Java programming language. Now Let us see the list of all the keywords in Java with their definition one by one.

 Note – All the keywords in Java Programming Language are in lower case characters . 

Java Keywords list and Definitions with PDF

I have divided all these 50 keywords in Java Programming language according to their functionalities in different categories, so it will be easier for you to understand and learn all these Java Keywords.

#1 Data Type Keywords

Java Keywords which are used to declare variables of different data types.

1. byte  : byte is a keyword used to store numbers ranging from -128 to 127.

2. short  : short keyword is used to store numbers ranging from -32768 to 32767.

3. int  : int keyword is used to store numbers ranging from -2147483648 to 2147483647.

4. long  : long keyword is used to store numbrs ranging from -9223372036854775808L to 9223372036854775807L. A letter ‘l’ or ‘L’ should be added to tell the compiler that the numbers is a long and not an int.

5. char  : char keyword is used to store single character/letters or ASCII values. Its value range is from ‘\u0000’ to ‘\uffff’ or 0 to 65535. All the characters must be enclosed within single quotes.

6. boolean  : boolean keyword is used to store values true or false.

7. float  : float keyword is used to store fractional values ranging from -3.4028235E38F to 3.4028235E38F. A letter ‘f’ or ‘F’ should be added to tell the compiler that the fraction is a float and not a double.

8. double  : double keyword is used to store fractional values ranging from -1.7976931348623157 x 10308 to 1.7976931348623157 x 10308 .

#2 Looping or Iterative statement Keywords

Java Keywords which are used for loops and Iterative statements.

9. for  : for keyword is used to start the for loop. It is an entry-controlled loop in which the condition is checked first, and then the loop body gets executed only if the condition is satisfied. If the number of iterations is known already, then it is recommended to use for loop.

10. while  : while keyword is used to start the while loop. It is also an entry-controlled loop. If the number of iterations is not known already, then it is recommended to use while loop.

11. do  : do keyword is used to start a do-while loop. It is used along with the while to create a do-while loop. do-while loop is an exit-controlled loop in which, first of all the loop body gets executed and then the condition is checked while exiting from the loop body.

#3 Conditional statement Keywords

Java Keywords which are used for Conditional statements.

12. if  : if keyword is used to create the if conditional statement. if the condition is true, then the if block gets executed.

13. else  : else keyword is used when the if condition becomes false, and then the else block gets executed. It indicated the alternative branches in an if statement.

14. switch  : switch keyword is used to create the switch statement, which is used to execute different cases based on test value.

15. case  : case keyword is used inside the switch-case block to create each case.

16. default  : default keyword is used inside the switch-case block. If non of the cases matches, then the default block gets executed.

17. continue  : continue keyword is used to skip the statement following it inside the loop body and moves the control to the end of the loop body, and the control is automatically passed to the next iteration, and then the same loop body gets executed from the next round in usual manner.

18. break  : break keyword is used to break out of a loop body or the switch block. The break statement is used for early exiting from the loop or switch statement at specified conditions.

19. goto **  : Not in use and has no function.

#4 Function Keywords

Keywords which are used basically with some functions.

20. void  : void keyword is used to specify a method which does not return any value.

21. return  : return keyword in Java is used to return back the control along with the value from the called method(function) to the calling place.

#5 Object Keywords

Java Keywords which are related to objects in Java program.

22. new  : new keyword in Java is used to create the instance of a class by dynamically allocating memory for a new object.

23. this  : this keyword in Java is used to refer to the current object inside a method or constructor. It is also used to distinguish between the instance variable and local variable.

24. super  : this keyword in Java is used to refer to the objects of the super class. It is used when we want to call the super class variable, method and constructor through sub-class object.

25. instanceof  : instanceof keyword is used to check if the given object is an instantiated object of the specified class or not. It returns the boolean value.

#6 Access Specifier Keywords

Java Keywords which are related to specify the accessibility or scope of a field, method, constructor or class.

26. public  : public keyword in Java is used for classes, methods, variables and constructors, which makes them accessible from anywhere.

27. private  : private keyword in Java is used to specify that a method, constructor or variable will be accessible only within the declared class.

28. protected  : private keyword in Java is used to specify that a method, constructor or variable will be accessible within the package and outside the package through inheritance only.

#7 Non-Access Modifier Keywords

Java keywords which do not have anything related to the level of access but they provide a special functionality when specified.

29. final  : final keyword in Java is used with variables, methods and classes. A final variable is a constant value which cannot be changed. By making a method final, we cannot override it. By making a class final, we cannot extend it.

30. static  : static keyword in Java is used with variables, methods, blocks and classes. The static variables and methods get associated with the class as a whole rather than belonging to the individual object. The static keyword is used with variables and methods to make them constant for every instance of the class.

31. abstract  : abstract keyword in Java is used to create abstract classes and abstract methods. The abstract methods do not have the body of themselves and must be overridden in all child classes. The class which contains an abstract method must be declared as an abstract class using the abstract keyword, and we can not instantiate that class.

32. synchronized  : The synchronization keyword in Java is used to create a synchronization block that allows only a single thread to access the shared data or resources at a particular point of time. It specifies the critical sections or methods in multithreaded code.

33. transient  : transient keyword in Java is used with instance variables to exclude them from the serialization process. It cannot be used with the static keyword.

34. volatile  : volatile keyword in Java is used to indicate the visibility of variables modified by multiple threads during concurrent programming i.e every read or write of the volatile variable will be to the main memory and not the CPU cache.

35. strictfp  : strictfp keyword in Java is used to make floating-point calculations platform independent.

 Note : This keyword was added in JDK 1.2 version

36. native  : native keyword in Java is used to create a method native which indicates that the method’s implementation is also written in different languages like C and C++ in native code using JNI(Java Native Interface).

#8 Declarative Keywords

Java Keywords which are used to delcare something in Java progamming.

37. package  : package keyword in Java is used to declare a Java package which includes classes, sub-packages, and interfaces.

38. import  : import keyword in Java is used to make classes and interfaces inside a package accessible to the current source code.

39. class  : class keyword in Java is used to declare a new class in Java.

40. interface  : interface keyword in Java is used to declare an interface that only contains the abstract methods.

41. enum  : enum keyword in Java is used to declare the enumerated(unchangeable) type, which are fixed set of constants. The constructors of enum are always private or default.

 Note : This keyword was added in JDK 5.0 version. 

42. const**  : Not in use and has no function.

#9 Inheritance Keywords

Java Keywords which are related to inheritance in Java programming

43. implements  : implements keyword in Java is used to implement(kind of inheritance) an interface in a class. The interface contains only abstract methods, and to access those methods, another class must implement the interface using the implements keyword.

44. extends  : extends keyword in Java is used to inherit a new class from the base class using inheritance.

#10 Exception Keywords

Java Keyword which are related with exception handling in Java programming

45. throw  : throw keyword in Java is used to throw an exception explicitly from a method or block of code. It is usually used with custom-made exceptions.

46. throws  : throws keyword in Java is used to declare exceptions that can be thrown from a method during the program execution.

47. try  : try keyword in Java is used to create the try block, which is tested for any kind of exceptions while it is being executed. A try block must be followed by either catch or finally block.

48. catch  : catch keyword in Java is used to create the catch block. When any exception occurs in the try block, it is caught by the catch block and is only used after the try block.

49. finally  : finally keyword in Java is used to create the finally block, which is used after the try-catch block, and the finally block always gets executed whether an exception is found or not.

50. assert   : assert keyword in Java is used to create an assertion(assumption), which is a condition that should be true during the program execution. during runtime if the assertion is false then an AssertionError is thrown.

 Note : This keyword was added in JDK 1.4 version. 

Points to Remember on Java Keywords

      • true, false, and null are just like keywords, but they are actually literals
      • You can’t use any of the above keywords as an identifier in your program

Java Keywords list and Definitions PDF Download

  • You can download the Java Keywords list and Definitions PDF from the link below.

So, guys, I am wrapping up this article, “Java Keywords list and Definitions PDF” Feel free to drop us a comment if you find something difficult to understand.


Related Articles

Java Button Click Event Tutorial
Login Form in Java Swing
Java Text to Speech
Java and MySQL Database Connectivity using Eclipse
Java and MySQL Database Connectivity using NetBeans
Registration Form in Java with Database Connectivity
Tic-Tac-Toe Game in Java with Source Code
Calculator App in Java using Swing
Java Interview Questions with PDF

Leave a Comment