Java Keywords

In Java, keywords are reserved words that have a predefined meaning and cannot be used as identifiers (e.g., variable names, class names, method names) in your code. These keywords are an integral part of the Java programming language and serve specific purposes within the language’s syntax and semantics.

Related Tags

Tutorials

Java 14

The yield keyword in Java

Introduced in Java 13 as part of the enhancements in Project Amber, the ‘yield‘ keyword aims to simplify code, making switch expressions more concise and expressive. Let us learn about ‘yield‘ keyword, its purpose, syntax, and see some practical examples. 1. The ‘yield‘ Keyword The ‘yield’ keyword enhances the switch expressions by allowing the expression …

Difference between this and super in Java

this and super are reserved keywords in Java. this refer to current instance of a class while super refer to the parent class of that class where super keyword is used.

Difference between final, finally and finalize in Java

In this Java tutorial, learn about difference between final, finally and finalize in detail. In short, final is a keyword, finally is a block and finalize is a method. They have their own very specific purpose in Java programs.

Java synchronized keyword

Java synchronized keyword marks a block or method a critical section. A critical section is where one and only one thread is executing at any given time.

Java boolean keyword

Java boolean keyword is used to declare a variable as a boolean type which represents only one of two possible values i.e. either true or false.

Java Abstract Classes and Methods

Java abstract keyword can be used with classes and methods; but not with variables. abstract is non-access modifier which helps in achieving abstraction.

Java transient keyword example

The Java transient keyword is used on class attributes/variables to indicate that serialization process of such class should ignore such variables while creating a persistent byte stream for any instance of that class. A transient variable is a variable that can not be serialized. According to Java Language Specification [jls-8.3.1.3] …

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.