🌐
Wikipedia
en.wikipedia.org › wiki › List_of_Java_keywords
List of Java keywords - Wikipedia
October 20, 2025 - This keyword is also used to declare that a method returns a value of the primitive type byte. ... A statement in the switch block can be labeled with one or more case or default labels. The switch statement evaluates its expression, then executes all statements that follow the matching case label; see switch.
🌐
W3Schools
w3schools.com › java › java_ref_keywords.asp
Java Keywords
Note: true, false, and null are not keywords, but they are literals and reserved words that cannot be used as identifiers. ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: [email protected] · If you want to report an error, or if you want to make a suggestion, send us an e-mail: [email protected] · HTML Tutorial CSS Tutorial JavaScript Tutorial How To Tutorial SQL Tutorial Python Tutorial W3.CSS Tutorial Bootstrap Tutorial PHP Tutorial Java Tutorial C++ Tutorial jQuery Tutorial
🌐
Oracle
docs.oracle.com › javase › tutorial › java › nutsandbolts › _keywords.html
Java Language Keywords (The Java™ Tutorials > Learning the Java Language > Language Basics)
See Java Language Changes for a summary of updated language features in Java SE 9 and subsequent releases. See JDK Release Notes for information about new features, enhancements, and removed or deprecated options for all JDK releases. Here is a list of keywords in the Java programming language.
🌐
GeeksforGeeks
geeksforgeeks.org › java › java-keywords
Java Keywords - GeeksforGeeks
August 27, 2018 - In Java, keywords are the reserved words that have some predefined meanings and are used by the Java compiler for some internal process or represent some predefined actions.
🌐
Scaler
scaler.com › topics › what-is-keyword-in-java
What is Keyword in Java? - Scaler Topics
December 19, 2022 - In Java, a keyword is a reserved word that conveys a specific meaning to the Java compiler. Keywords are special words that have a predefined meaning to the Java compiler. They are reserved words and cannot be used as an identifier, function ...
🌐
Doubtnut
doubtnut.com › class 10 › computer science
Then is not Java keywords:
True, false, and null are not keywordsThen is not Java keywords:
🌐
University of North Carolina
cs.unc.edu › ~weiss › COMP14 › 18-JavaKeyWords.html
Java key words
Keywords for catch-exception are: try catch finally throw · Keywords for loops or decision-makers are: break case continue default do while for switch if else · Keywords for class functions are: class extends implements import instanceof new package return interface this throws void super ·
🌐
Igmguru
igmguru.com › blog › java-keywords
Java Keywords – 68 Java Keywords Explained
1 month ago - Now that you know each type of keywords in Java, let's explore an example on how to use them: This code example prints messages to your console. It demonstrates fundamental concepts like defining a class, the entry point and how to display output. It is a foundational example for anyone starting with the Java programming language.
🌐
DataFlair
data-flair.training › blogs › java-keywords
Java Keywords - List of 51 Keywords with Examples - DataFlair
May 12, 2024 - 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 it is essential that a programmer knows all the keywords to avoid any kind of syntax or logical errors.
Find elsewhere
🌐
Jchq
jchq.net › certkey › 0404certkey.htm
4.3) Java Key words
Which of the following are not Java keywords? 1)volatile 2)sizeOf 3)goto 4)try · 1) double 4) instanceof Note the upper case S on switch means it is not a keyword and the word then is part of Visual Basic but not Java
🌐
DataCamp
datacamp.com › doc › java › category › keywords
Java Keywords
In Java, keywords are reserved words that have a predefined meaning in the language. They form the foundation of Java's syntax and cannot be used as identifiers, such as variable names, method names, or class names.
🌐
TheServerSide
theserverside.com › definition › Java-keyword
What is Java keyword? | Definition from TechTarget
In contrast, many other programming languages compile code into platform-specific binary files, so programs written for a particular platform (e.g., Windows) cannot run on other platforms (e.g., Mac or Linux). Java is object-oriented. Java was mainly built as an object-orientated language, where a programmer-created object is made up of data as fields or attributes and code as procedures or methods.
🌐
Javatpoint
javatpoint.com › java-keywords
Java Keywords - Javatpoint
Java Keywords with java tutorial, features, history, variables, object, class, programs, operators, swith, for-loop, oops concept, inheritance, array, string, map, math, methods, examples etc.
🌐
Software Testing Help
softwaretestinghelp.com › home › java › important java keywords list – reserved words in java
Important Java Keywords List - Reserved Words In Java
April 1, 2025 - Also Read => Java ‘THIS’ Keyword With Code Examples ... A static keyword is a keyword that is used to indicate an object that cannot be instantiated. So if we have a static method, then it need not be called using an object.
Top answer
1 of 2
5

Keywords are special words in the grammar of a language. A keyword has a special meaning in a language. Personally I like to distinguish more between reserved words and keywords and built-in types but that's just me. (I wouldn't call int a keyword for example, it's just a built-in type so at best it's a reserved word).

These things are treated differently by the compiler. The compiler knows how to handle public, int, void, class etc.

Update

Actually it's not true that you need to import the package to use the scanner:

public void M() throws FileNotFoundException {
    java.util.Scanner scanner = new java.util.Scanner(new File(""));
}

This is a valid snippet of code. import just import things into your namespace. If you have for example a java.util.Scanner and a com.business.Scanner you can not import them both because you now have a conflict in your namespace: You have two Scanners.

Scanner is NOT part of the java language. int is. As far as your compiler is concerned there's no such thing as Scanner but there are such things as int, double. In essence: The definitions for these keywords are built into the compiler. Primitive data types are built-in types the compiler knows about. You do not have to tell the compiler what a double is, it just knows. However, you do have to tell your compiler what a Scanner is. (Of course, if you're writing a compiler you do have to teach the compiler you're writing what a double is).

Keywords like while, public are different because they are not data types. They are part of the grammar (and semantics) of the language. The compiler knows how to treat these. If it sees a while it produces machine code (or bytecode in java) that loops as long as a certain condition is true.

Think of a simple language with a grammar like this:

Program: <Identifier>, 'says', <Text>
Identifier: Character | Character, Identifier
Text: '"', [Character], '"'

This looks confusing but essentially this grammar means that a Program (sentence) starts with a Name, is then followed by says and then followed by Text. In this case says IS a keyword. It has a special meaning in the language. For example the compiler will produce code that displays the text on screen when it sees such a program with says in it.

2 of 2
0

The compiler follows these simple rules when it finds an identifier:

  1. Looks it in the list of built-in keywords (like public, abstract, return, etc). If it is included in that list, then it is a keyword.
  2. If not found, same with built-in types (like int, char, double, float, etc).
  3. If not found, looks it in current scope's definitions, in this order:
    • Within the current block.
    • Within the current method.
    • Within the current class or interface.
    • Within the current package.
  4. If not found, looks it in the definitions imported in the current source (through the import declarations).

As you can see, the built-in types and reserved keywords have always priority, no matter the current scope or declared imports.

🌐
Medium
theoretes.medium.com › keywords-of-java-1f5377b74acf
Keywords of Java. Introduction of Java Keywords | by Oretes | Medium
April 18, 2020 - In java, the continue keyword is use to stop execution of a current repetition in a for loop or a while loop, then advance to the next repetition.
🌐
Quora
quora.com › What-is-a-keyword-in-Java
What is a keyword in Java? - Quora
Answer (1 of 9): In java Keyword is a word, It contain it's own reorganization as well as meaningful functionality. In Java totally 50 keywords are there. In that 50 keywords, used keywords are 48 and Un-used keywords are 2(goto, const). Unused keywords always confuse the Developer. Let me exp...
🌐
TechVidvan
techvidvan.com › tutorials › keywords-in-java
Keywords in Java - Java Reserved Words - TechVidvan
June 5, 2020 - The synchronized keyword in Java is used to achieve synchronization in Java in a multi-threaded environment. The methods that are critical and need to be accessed by only a single resource at the same time, then these methods are declared as synchronized with the help of a synchronized keyword.
🌐
GeeksforGeeks
geeksforgeeks.org › java › important-keywords-java
Important Keywords in Java - GeeksforGeeks
July 23, 2025 - For more, refer to abstract keyword in java ... instanceof: It is used to know whether the object is an instance of the specified type (class or subclass or interface). private: It is an access modifier. Anything declared private cannot be seen outside of its class. protected: If you want to allow an element to be seen outside your current package, but only to classes that subclass your class directly, then ...
🌐
Wikibooks
en.wikibooks.org › wiki › Java_Programming › Keywords
Keywords - Wikibooks, open books for an open world
January 31, 2006 - In Java 1.5 and later, the "super" keyword is also used to specify a lower bound on a wildcard type parameter in Generics. ... It is a branching operation, based on a number. The 'number' must be either char, byte, short, or int primitive type. ... switch ( <integer-var> ) { case <label1>: <statements>; case <label2>: <statements>; ... case <labeln>: <statements>; default: <statements>; } When the <integer-var> value match one of the <label>, then: The statements after the matched label will be executed including the following label's statements, until the end of the switch block, or until a break keyword is reached.