Java Keywords Flashcards
Learn reserved keywords in Java from W3Schools Java Keywords list: https://www.w3schools.com/java/java_ref_keywords.asp
abstract
A non-access modifier. Used for classes and methods: An abstract class cannot be used to create objects (to access it, it must be inherited from another class). An abstract method can only be used in an abstract class, and it does not have a body. The body is provided by the subclass (inherited from)
assert
For debugging
boolean
A data type that can only store true and false values
break
Breaks out of a loop or a switch block
byte
A data type that can store whole numbers from -128 and 127
case
Marks a block of code in switch statements
catch
Catches exceptions generated by try statements
char
A data type that is used to store a single character
class
Defines a class
continue
Continues to the next iteration of a loop
default
Specifies the default block of code in a switch statement
do
Used together with while to create a do-while loop
double
A data type that can store whole numbers from 1.7e−308 to 1.7e+308
else
Used in conditional statements to specify a new condition if the first condition is false
enum
Declares an enumerated (unchangeable) type
exports
Exports a package with a module. New in Java 9
extends
Extends a class (indicates that a class is inherited from another class)
final
A non-access modifier used for classes, attributes and methods, which makes them non-changeable (impossible to inherit or override)
finally
Used with exceptions, a block of code that will be executed no matter if there is an exception or not
float
A data type that can store whole numbers from 3.4e−038 to 3.4e+038
for
Create a for loop
if
Makes a conditional statement
implements
import
Used to import a package, class or interface
instanceof
Checks whether an object is an instance of a specific class or an interface
interface
Used to declare a special type of class that only contains abstract methods
int
A data type that can store whole numbers from -2147483648 to 2147483647
long
A data type that can store whole numbers from -9223372036854775808 to 9223372036854775808
module
Declares a module. New in Java 9
native
Specifies that a method is not implemented in the same Java source file (but in another language)