

{"id":15422,"date":"2018-05-25T06:00:09","date_gmt":"2018-05-25T06:00:09","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=15422"},"modified":"2026-05-18T13:01:37","modified_gmt":"2026-05-18T07:31:37","slug":"java-keywords","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/java-keywords\/","title":{"rendered":"Java Keywords &#8211; List of 51 Keywords with Examples"},"content":{"rendered":"<p>In a programmer&#8217;s life, knowing all the keywords are very essential to build a program properly. In this article, we will discuss all the keywords that JDK has in reserve.<\/p>\n<h3>What are Keywords in Java?<\/h3>\n<p>Keywords are special tokens that add a different meaning to the language compiler. Each keyword has its own individual function and performs a specific task assigned to it. In Java, we have 50 such reserved words, out of which 48 are in use, and 2 are reserved but not in use. Keywords cannot be used as identifiers in a program, so a programmer must know all the keywords to avoid any kind of syntax or logical errors.<\/p>\n<p>Let us study all the keywords that Java provides us with in detail.<\/p>\n<p><strong>1. abstract:<\/strong> Using the abstract keyword in Java, we can create abstract classes and methods. Abstract keywords are essential to implement abstraction into a program.<\/p>\n<p><strong>Example of abstract in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">abstract class DataFlair\r\n<\/pre>\n<p><strong>2. assert:<\/strong> Using the assert keyword, we can implement assertion in a program. Using it we can check the correctness of any assumptions made in a program. The assert keyword was added in JDK 1.4.<\/p>\n<p><strong>Example of assert\u00a0in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">int i = 10;\r\n           assert i &gt; 5 : \"The value is greater than 5\";\r\n<\/pre>\n<p><strong>3. boolean:<\/strong> Using the boolean keyword, we can declare a boolean variable. A Boolean variable is a variable that has two values, true and false.<\/p>\n<p><strong>Example of boolean in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">boolean flag = true;\r\n<\/pre>\n<p><strong>4. break:<\/strong> The break keyword is a jump statement using which we can use to break out of a loop or switch statement. The break statement terminates the currently executing block of code.<\/p>\n<p><strong>Example of break in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">i=0;\r\nwhile(true)\r\n{\r\n     if(i==10)\r\n     break;\r\n     i++;\r\n}\r\n<\/pre>\n<p><strong>5. byte:<\/strong> Using the byte keyword in Java, we can declare a variable that can hold a value of 1 byte or 8 bit.<\/p>\n<p><strong>Example of byte in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">byte num=1;\r\n<\/pre>\n<p><strong>6. case:<\/strong> Using the case statement, we can declare each case inside a switch-case block. case keyword is used to give multiple conditions to switch statements. This is used in a switch case statement. It contains the statements, which are executed when the value in the case matches a condition.<\/p>\n<p><strong>Example of case in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">{\r\n     case 1:\r\n               System.out.println(\u201cONE\u201d);\r\n               break;\r\n}\r\n<\/pre>\n<p><strong>7. catch:<\/strong> The catch keyword is part of exception handling in Java. Using the catch keyword, we can catch or capture the error caught by the try block. A catch block can exist only after the try block.<\/p>\n<p><strong>Example of catch in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">catch (Exception e)\r\n{\r\n       System.out.println(\u201cAn exception was caught by the try block\u201d);\r\n}\r\n<\/pre>\n<p><strong>8. char:<\/strong> Using the char keyword, we can declare a character variable.<\/p>\n<p><strong>Example of char\u00a0in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">char ch=\u2019A\u2019;\r\n<\/pre>\n<p><strong>9. class: <\/strong> The class keyword in Java is used to declare Java classes. It usually contains the methods and variables, which are the attributes of the object.<\/p>\n<p><strong>Example of class in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class DataFlair\r\n<\/pre>\n<p><strong>10. continue:<\/strong> Continue is also a jump statement in Java. Using it, we can terminate the current iteration and continue from the next iteration inside the loop.<\/p>\n<p><strong>Example of continue in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">i=0;\r\nwhile(i&lt;=10)\r\n{\r\n     if(i==5)\r\n     continue;\r\n     i++;\r\n}\r\n<\/pre>\n<p><strong>11. default:<\/strong> default is the keyword using which we can declare the default statement inside a switch case. It is executed when none of the cases match.<\/p>\n<p><strong>Example of default in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Switch(num)\r\n{\r\n     case 1:\r\n               System.out.println(\u201cONE\u201d);\r\n               break;\r\n     default:\r\n               System.out.println(\u201cNot ONE\u201d);\r\n}\r\n<\/pre>\n<p><strong>12. do:<\/strong> Using the do keyword, we can declare a do-while loop. It is an exit-controlled loop, so it doesn\u2019t have any entry condition.<\/p>\n<p><strong>Example of do in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">i=0;\r\ndo{\r\n        i++;\r\n     }while(i&lt;=10);\r\n<\/pre>\n<p><strong>13. double:<\/strong> Using the double keyword, we can declare a double variable. A double variable can hold a 64bit long floating point number.<\/p>\n<p><strong>Example of double in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">double d= 1.23456;\r\n<\/pre>\n<p><strong>14. else:<\/strong> Using the else keyword, we can write statements that will be executed when the if block doesn\u2019t execute successfully.<\/p>\n<p><strong>Example of else in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">i=5;\r\nif(i!=5)\r\nSystem.out.println(\u201cNot Five\u201d);\r\nelse\r\nSystem.out.println(\u201cFIVE\u201d);\r\n<\/pre>\n<p><strong>15. enum:<\/strong> Using the enum keyword, we can declare an enumerated class. It consists of a fixed set of constants. Enum constructors are always private by default. The enum keyword was added to Java in JDK 5.0.<\/p>\n<p><strong>Example of enum in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">enum Rainbow\r\n{\r\n  Violet, Indigo, Blue, Green,\r\n  Yellow, Orange, Red;\r\n}\r\n<\/pre>\n<p><strong>16. extends:<\/strong> The extends keyword is used in inheritance. Using it we can inherit one class into another.<\/p>\n<p><strong>Example of extends in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class subclass extends superclass\r\n<\/pre>\n<p><strong>17. final:<\/strong> Using the final keyword, we can finalize the value of a variable. It means that the value cannot be updated by the user whatsoever.<\/p>\n<p><strong>Example of final in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">final int num = 1000; \r\n<\/pre>\n<p><strong>18. finally:<\/strong> The finally keyword is used after the try-catch block. It indicates the end of the block. Unlike the try-catch block, the finally block will be executed regardless of whether an exception is found or not.<\/p>\n<p><strong>Example of finally in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">finally{\r\nSystem.out.println(\"This block is always executed whatsoever!\");\r\n} \r\n<\/pre>\n<p><strong>19. float:<\/strong> Using the float keyword, we can declare a float variable in Java. Thus, the float variable holds a 32-bit long floating-point number.<\/p>\n<p><strong>Example of float in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">float num= 1.324f;\r\n<\/pre>\n<p><strong>20. for:<\/strong> Using the for keyword, we can declare a for loop. It is an entry-controlled loop; for this kind of loop, the number of iterations should be known beforehand.<\/p>\n<p><strong>Example of for in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">for(i=0;i&lt;10;i++)\r\n{\r\n    System.out.println(i);\r\n}\r\n<\/pre>\n<p><strong>21. if:<\/strong> In Java, the if keyword is used to declare an if conditional statement. Therefore, the if statement is used to check the viability of a condition.<\/p>\n<p><strong>Example of if\u00a0in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">i=5;\r\nif(i==5)\r\n{\r\n    System.out.println(\u201cThe Number is Five\u201d);\r\n}\r\n<\/pre>\n<p><strong>22. implements:<\/strong> Using the implements keyword in Java, we can declare an interface. However, it is like the inheritance extends keyword; here, to access an interface, we have to use the implements keyword.<\/p>\n<p><strong>Example of implements in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">interface DataFlair{\r\npublic void intern();\r\n}\r\nclass internship implements DataFlair\r\n{\r\n        Public void intern()\r\n       {\r\n                System.out.println(\u201cInternship Granted\u201d);\r\n        }\r\n}\r\n\r\n<\/pre>\n<p><strong>23. import:<\/strong> Using the import keyword in Java, we can access classes and interfaces present inside a package in the current code.<\/p>\n<p><strong>Example of import in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import java.util.Arrays; \r\n<\/pre>\n<p><strong>24. instanceof:<\/strong> Using the instanceof keyword in Java, we can check whether a given object is an instance of another class or not. Hence It returns true if the given object is an instance and false if not.<\/p>\n<p><strong>Example of instanceof in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">public class DataFlair {\r\n  public static void main(String[] args) {\r\n    DataFlair Obj1 = new DataFlair();\r\n    System.out.println(Obj1 instanceof DataFlair);\/\/ It will return True.\r\n  }\r\n}\r\n<\/pre>\n<p><strong>25. int:<\/strong> Using the int keyword, we can declare a variable of integer datatype. Therefore, it can hold a value of 32-bit long.<\/p>\n<p><strong>Example of int in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">int num=100;\r\n<\/pre>\n<p><strong>26. interface:<\/strong> Using the interface keyword in Java, we can declare an interface inside the code.<\/p>\n<p><strong>Example of interface in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">interface DataFlair{}\r\n<\/pre>\n<p><strong>27. long:<\/strong> Using the long keyword, we can declare variables with the long data type. Therefore, the long data type is an integer that can hold 64 bits of data.<\/p>\n<p><strong>Example of long in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">long num=100000;\r\n<\/pre>\n<p><strong>28. native:<\/strong> The native keyword in Java is used to indicate that a method is implemented in native code using JNI[Java Native Interface].<\/p>\n<p><strong>Example of native in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Public native void DataFlair();\r\n<\/pre>\n<p><strong>29. new:<\/strong> Using the new keyword, we can create a new instance of a class.<\/p>\n<p><strong>Example of new in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">public class DataFlair {\r\n  public static void main(String[] args) {\r\n    DataFlair Obj1 = new DataFlair();\r\n}\r\n<\/pre>\n<p><strong>30. Package:<\/strong> Using the package keyword in Java, we can create a new package in the Java library.<\/p>\n<p><strong>Example of Package in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">package com.DataFlair.Keywords;\r\n<\/pre>\n<p><strong>31. private:<\/strong> The private keyword is an access modifier that declares a class or method as private; i.e, it can only be accessed by its local variables.<\/p>\n<p><strong>Example of private in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">private class DataFlair{}\r\n<\/pre>\n<p><strong>32. protected:<\/strong> protected is also an access modifier that declares a class or method as protected; i.e, it can be accessed by files in the PWD(Present Working Directory).<\/p>\n<p><strong>Example of protected in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">protected class DataFlair{}\r\n<\/pre>\n<p><strong>33. public:<\/strong> public is another access modifier that declares a class or method as public; i,e; it can be accessed globally.<\/p>\n<p><strong>Example of public in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">public class DataFlair{}\r\n<\/pre>\n<p><strong>34. return:<\/strong> The return keyword is used inside a method when it is required to return a value of a certain return type, except void.<\/p>\n<p><strong>Example of return in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">int sum(int a, int b)\r\n{\r\n     return (a+b);\r\n}\r\n \r\n<\/pre>\n<p><strong>35. short:<\/strong> In Java, the short keyword declares variables that can hold an integer value of 16 bits.<\/p>\n<p><strong>Example of short in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">short num=1;\r\n<\/pre>\n<p><strong>36. static:<\/strong> In Java, the static keyword declares a static variable or method. Hence, A static variable or method is stored in a static memory location.<\/p>\n<p><strong>Example of static in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">public static void main() \r\n<\/pre>\n<p><strong>37. strictfp:<\/strong> In Java, the strictfp keyword ensures that every platform gets the same result for floating-point operations. The strictfp keyword is used on classes, methods, and interfaces. However, this keyword was introduced in JDK 1.2.<\/p>\n<p><strong>Example of strictfp in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">strictfp class DataFlair{}\r\n<\/pre>\n<p><strong>38. super:<\/strong> The super keyword distinguishes variables with the same name in both the parent class and child class in inheritance.<\/p>\n<p><strong>Example of super in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class DataFlair\r\n{\r\n     String name=\u201dCompany\u201d;\r\n}\r\nclass internship extends DataFlair\/\r\n{\r\n     String name=\u201dIntern\u201d;\r\n     System.out.println(name);\/\/Intern will be printed\r\n     System.out.println(super.name);\/\/Company will be printed\r\n}\r\n<\/pre>\n<p><strong>39. switch:<\/strong> Using the switch keyword, we can initiate the switch case block in Java code.<\/p>\n<p><strong>Example of switch in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Switch(num)\r\n{\r\n     case 1:\r\n               System.out.println(\u201cONE\u201d);\r\n               break;\r\n     default:\r\n               System.out.println(\u201cNot ONE\u201d);\r\n}\r\n<\/pre>\n<p><strong>40. synchronized:<\/strong> Using the synchronized keyword in Java, we can specify the critical section to be executed during multithreaded coding.<\/p>\n<p><strong>Example of synchronized keyword in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">synchronized void print(int num)<\/pre>\n<p><strong>41. this:<\/strong> this keyword in Java is used to distinguish local variables from global variables.<\/p>\n<p><strong>Example of this in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">class DataFlair{\r\nString name;\r\nDataFlair(String name)\r\n{\r\n     this.name=name;\r\n}\r\n}\r\n\r\n<\/pre>\n<p><strong>42. throw:<\/strong> The throw keyword in Java is used to throw custom-made exceptions explicitly into the code.<\/p>\n<p><strong>Example of void in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">throw new IOException(\"The Input is Not Acceptable\u201d); \r\n \r\n<\/pre>\n<p><strong>43. throws:<\/strong> The throws keyword is used to propagate a checked exception.<\/p>\n<p><strong>Example of throws in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import java.io.*;  \r\nclass DataFlair{  \r\n void internship()throws IOException{  \r\n  throw new IOException(\"Internship Not Found\");  \r\n }  \r\n}  \r\n<\/pre>\n<p><strong>44. transient:<\/strong> Using the transient keyword in Java, we can deserialize a variable. Therefore, when a variable is declared transient, it is not considered for serialization.<\/p>\n<p><strong>Example of a transient in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">transient int num;\r\n<\/pre>\n<p><strong>45. try:<\/strong> The try block is used in exception handling to test a block of code for exceptions. Therefore, the try block is always followed by a catch block or finally block.<\/p>\n<p><strong>Example of try in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\"> try{\r\n\/\/statement\r\n}catch(exception e){}\r\n\r\n<\/pre>\n<p><strong>46. void:<\/strong> Using the void keyword, we can declare that the method will not return any value.<\/p>\n<p><strong>Example of void in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">void main()\r\n<\/pre>\n<p><strong>47. volatile:<\/strong> The volatile keyword in Java is used to indicate that a variable can change asynchronously.<\/p>\n<p><strong>Example of volatile in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">static volatile int num=100;\r\n<\/pre>\n<p><strong>48. while:<\/strong> Using the While keyword, we can declare a while loop. A while loop is an entry-controlled loop, where the number of iterations is not fixed.<\/p>\n<p><strong>Example of while in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">i=5;\r\nwhile(i&lt;=10)\r\n{\r\n    i++;\r\n}\r\n<\/pre>\n<p><strong>Note:<\/strong> Two other keywords are reserved but not used: <strong>const<\/strong> and <strong>goto.<\/strong> Words like true, false, and null might seem like keywords, but they are actually literals.<\/p>\n<h3>Learning and Remembering Keywords in Java<\/h3>\n<p>While memorising all Java keywords can seem daunting at first, there are effective strategies to aid your learning process. Here are some tips to consider:<\/p>\n<ul>\n<li><strong>Group keywords by functionality:<\/strong> Categorise keywords based on their purpose (e.g., control flow, object-oriented programming, exception handling). Therefore, this mental organization can strengthen your understanding and recall.<\/li>\n<li><strong>Practice writing simple code snippets:<\/strong> Create small programs that utilize various keywords. Hence, experimenting with code reinforces your knowledge and clarifies how keywords interact within the broader Java syntax.<\/li>\n<li><strong>Utilize online resources:<\/strong> Take advantage of interactive quizzes, flashcards, and mnemonic devices available online. Therefore, these tools can make learning keywords more engaging and interactive.<\/li>\n<\/ul>\n<h3>Conclusion<\/h3>\n<p>In this article, we took a brief look at all the keywords that are present in Java. However, each of these keywords has a vast role in coding. Knowing each keyword in detail is essential for every programmer.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a programmer&#8217;s life, knowing all the keywords are very essential to build a program properly. In this article, we will discuss all the keywords that JDK has in reserve. What are Keywords in&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":108894,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[4164,7473,7474,7475,7476,7477,7570,8324,15806],"class_list":["post-15422","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","tag-enum","tag-java-enum","tag-java-enum-constructor","tag-java-enum-example","tag-java-enum-methods","tag-java-enum-valueof","tag-java-keyword-list","tag-list-of-abstract-data-types","tag-what-is-keyword-in-java"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Java Keywords - List of 51 Keywords with Examples - DataFlair<\/title>\n<meta name=\"description\" content=\"Java Keywords are predefined or reserved words used to restrict the programmer. Learn more about these keywords with syntax and examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/java-keywords\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java Keywords - List of 51 Keywords with Examples - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Java Keywords are predefined or reserved words used to restrict the programmer. Learn more about these keywords with syntax and examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/java-keywords\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-05-25T06:00:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-05-18T07:31:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/java-keywords.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java Keywords - List of 51 Keywords with Examples - DataFlair","description":"Java Keywords are predefined or reserved words used to restrict the programmer. Learn more about these keywords with syntax and examples.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/java-keywords\/","og_locale":"en_US","og_type":"article","og_title":"Java Keywords - List of 51 Keywords with Examples - DataFlair","og_description":"Java Keywords are predefined or reserved words used to restrict the programmer. Learn more about these keywords with syntax and examples.","og_url":"https:\/\/data-flair.training\/blogs\/java-keywords\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-05-25T06:00:09+00:00","article_modified_time":"2026-05-18T07:31:37+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/java-keywords.webp","type":"image\/webp"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/java-keywords\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/java-keywords\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"Java Keywords &#8211; List of 51 Keywords with Examples","datePublished":"2018-05-25T06:00:09+00:00","dateModified":"2026-05-18T07:31:37+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/java-keywords\/"},"wordCount":1714,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/java-keywords\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/java-keywords.webp","keywords":["enum","java enum","java enum constructor","java enum example","java enum methods","java enum valueof","java keyword list","list of Abstract Data Types","what is keyword in java"],"articleSection":["Java Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/java-keywords\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/java-keywords\/","url":"https:\/\/data-flair.training\/blogs\/java-keywords\/","name":"Java Keywords - List of 51 Keywords with Examples - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/java-keywords\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/java-keywords\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/java-keywords.webp","datePublished":"2018-05-25T06:00:09+00:00","dateModified":"2026-05-18T07:31:37+00:00","description":"Java Keywords are predefined or reserved words used to restrict the programmer. Learn more about these keywords with syntax and examples.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/java-keywords\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/java-keywords\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/java-keywords\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/java-keywords.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/java-keywords.webp","width":1200,"height":628,"caption":"java keywords"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/java-keywords\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Java Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/java\/"},{"@type":"ListItem","position":3,"name":"Java Keywords &#8211; List of 51 Keywords with Examples"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team creates expert-level guides on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our goal is to empower learners with easy-to-understand content. Explore our resources for career growth and practical learning.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/15422","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=15422"}],"version-history":[{"count":21,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/15422\/revisions"}],"predecessor-version":[{"id":148339,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/15422\/revisions\/148339"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/108894"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=15422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=15422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=15422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}