0% found this document useful (0 votes)
8 views3 pages

4

The document provides a comprehensive list of 51 reserved keywords in Java, which cannot be used as variable names or identifiers. Each keyword is accompanied by its usage and functionality within the Java programming language. Additionally, it notes that 'true', 'false', and 'null' are reserved literals, while 'const' and 'goto' are reserved but not currently in use.

Uploaded by

anjanabahzala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

4

The document provides a comprehensive list of 51 reserved keywords in Java, which cannot be used as variable names or identifiers. Each keyword is accompanied by its usage and functionality within the Java programming language. Additionally, it notes that 'true', 'false', and 'null' are reserved literals, while 'const' and 'goto' are reserved but not currently in use.

Uploaded by

anjanabahzala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Java Keywords

List of all Java Keywords :-


Keywords are reserved words in Java that serve as a code key. These words can't be used for anything else because they're predefined. They
can't be used as a variable name, object name, or any other identifier. There are 51 reserved terms or keywords in Java. There are used for
some internal process or represent some predefined actions.

Keywords or Reserved words are the words in a language that These words are therefore not allowed to use as variable names or objects.

S.No Keyword Usage

1. abstract Specifies that a class or method will be implemented later, in a subclass

Assert describes a predicate placed in a java program to indicate that the developer
2. assert
thinks that the predicate is always true at that place.

3. boolean A data type that can hold True and False values only

4. break A control statement for breaking out of loops.

5. byte A data type that can hold 8-bit data values

6. case Used in switch statements to mark blocks of text

7. catch Catches exceptions generated by try statements

8. char A data type that can hold unsigned 16-bit Unicode characters

9. class Declares a new class

10. continue Sends control back outside a loop

11. default Specifies the default block of code in a switch statement

12. do Starts a do-while loop

13. double A data type that can hold 64-bit floating-point numbers

14. else Indicates alternative branches in an if statement

A Java keyword is used to declare an enumerated type. Enumerations extend the base
15. enum
class.

16. extends Indicates that a class is derived from another class or interface

17. final Indicates that a variable holds a constant value or that a method will not be overridden

18. finally Indicates a block of code in a try-catch structure that will always be executed

19. float A data type that holds a 32-bit floating-point number

20. for Used to start a for loop

21. if Tests a true/false expression and branches accordingly

22. implements Specifies that a class implements an interface

23. import References other classes

24. instanceof Indicates whether an object is an instance of a specific class or implements an interface

25. int A data type that can hold a 32-bit signed integer

26. interface Declares an interface

27. long A data type that holds a 64-bit integer

28. native Specifies that a method is implemented with native (platform-specific) code

29. new Creates new objects

30. null This indicates that a reference does not refer to anything

31. package Declares a Java package

An access specifier indicating that a method or variable may be accessed only in the
32. private
class it’s declared in

An access specifier indicating that a method or variable may only be accessed in the
33. protected class it’s declared in (or a subclass of the class it’s declared in or other classes in the
same package)

Java Keywords 1
An access specifier used for classes, interfaces, methods, and variables indicating that an
34. public item is accessible throughout the application (or where the class that defines it is
accessible)

35. return Sends control and possibly a return value back from a called method

36. short A data type that can hold a 16-bit integer

Indicates that a variable or method is a class method (rather than being limited to one
37 static
particular object)

A Java keyword is used to restrict the precision and rounding of floating-point


38. strictfp
calculations to ensure portability.

39. super Refers to a class’s base class (used in a method or class constructor)

40. switch A statement that executes code based on a test value

41. synchronized Specifies critical sections or methods in multithreaded code

42. this Refers to the current object in a method or constructor

43. throw Creates an exception

44. throws Indicates what exceptions may be thrown by a method

45. transient Specifies that a variable is not part of an object’s persistent state

46. try Starts a block of code that will be tested for exceptions

47. void Specifies that a method does not have a return value

48. volatile This indicates that a variable may change asynchronously

49. while Starts a while loop

Note: true, false and null are not keywords, but they are Reserved literals that cannot be used as identifiers.
The keywords
const and goto are reserved, even they are not currently in use. Currently they are no longer supported in Java.

Java Keywords 2
DURGA SIR :-

byte , short , int , long , float , double , boolean , char………………………………………………………………...8

if, else , switch , case , default , do , while , for , break , continue , return………………………………….11
public , private , protected , static , final , synchronized , native , {strictfp} , transient ,volatile…11
try , catch ,throw , throws , finally , {assert}…………………………………………………………………………….….6

class , interface , extends , implements , package , import …………………………………………..…………..6


new , instance , super , this ………………………………………………………………………………………………………….4
void……………………………………………………………………………………………………………………………………………….1

goto , const …………………………………………………………………………………………………………………………………….2


true , false , null……………………………………………………………………………………………………………………..………3
{enum}…………………………………………………………………………………………………………………………………………..1

Java Keywords 3

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy