Java Keywords and List of all java keywords

.
Keywords in Java and list of Java Keywords

What is Keywords?
 keywords are also known as the Reserved words /pre-define keywords. In Java Reserved keywords are used for some internal process or predefined action. In Java Programming Language we can not use keywords as variable names or objects. If we do the same then the Java compiler throws an error.

List Of all Java Keywords 
A list of all Java Keywords or Reserved Keywords is given below


Total Java keywords :( 50)

Data Types: byte, short, int, long, float, double, char, Boolean (8)

Flow-Control: if, else, switch, case, default, break, for, while, do, continue (10)

method-level:-  void, return (2)

Object-level:- new, this, super, instance (4)

source-file: class, extends, interface, implements, package, import (6)

Exception handling:-  try, catch, finally, throw, throws (5)

1.5 version:- enum, assert (2)

Modifiers:- public, private, protected, abstract, final, static strictfp, native, transient, volatile, synchronized (11)

 Predefined constants: True, false, null (3)

unused:-  goto ,const(2)


Keywords (50) + constants (3) = Reserved Words (53)


Brief Explanation of Java Keywords 

1) byte:   To declare a variable that can hold 8-bit data values we use byte keywords .

2) short: To declare a variable that can hold a 16-bit integer we use the short keyword.

3) int: To declare a variable that can hold a 32-bit signed integer we use the int keyword .

4) Long: To declare a variable that can hold a 64-bit integer we use the long keyword.

5) float :   To declare a variable that can hold a 32-bit floating point number we use the float keyword.  

6) double : To Declare a variable that can hold the 64-bit floating point Number we use double keywords.

7) char:   To declare a variable that can hold the unsigned 16-bit Unicode character we use char keywords.

8) boolean: To declare a variable as boolean we use the boolean keywords. boolean keywords hold only TRUE and FALSE Values.

9) if:  To Test the True/false expression and branches we use the if keyword. 

10) else: To indicate the alternative branches in an if statement we use the else keyword.

11) switch: A statement that executes code based on a test value we use the switch keyword.

12) case: Case keyword in Java is used to mark blocks of text in a switch statement.

13) default: To Specify the default block of code in a switch statement we use the default keyword.

14) break: To Break the loop or switch statement we use the break keyword.

15) for: To start for loop we use for keyword .

16) while: To Start a while loop we use the while keyword.

17) do: To start a do while loop we use the do keyword.

18) continue: To continue the loop we use continue keyword which sends control back outside the loop.
 19)  void

20) return

21) new 

22) this

23) super

24) instanceof

25) class

26) extends

27) interface

28) implements

29) package

30) import

31) try

32) catch

33) finally

34) throw

35) throws

36) enum (1.5 version)

37) assert (1.5 version)

38) public

39) private

40) protected

41) abstract

42) final

43) static

44) strictfp

45) native

46) transient

47) volatile

48) synchronized

49)True


50)false


51)null 



52)goto

53)const

Reserved words (53):- Keywords (50) + constants (3) = Reserved Words (53)


Hope !!! The above tutorial on Java keywords With a list of 50 Java keywords is helpful For You ... 

Team, 
QA acharya


Java Keyword and list of Java keyword 


Post a Comment

0 Comments