Java Keywords Flashcards

Learn reserved keywords in Java from W3Schools Java Keywords list: https://www.w3schools.com/java/java_ref_keywords.asp

1
Q

abstract

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

assert

A

For debugging

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

boolean

A

A data type that can only store true and false values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

break

A

Breaks out of a loop or a switch block

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

byte

A

A data type that can store whole numbers from -128 and 127

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

case

A

Marks a block of code in switch statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

catch

A

Catches exceptions generated by try statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

char

A

A data type that is used to store a single character

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

class

A

Defines a class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

continue

A

Continues to the next iteration of a loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

default

A

Specifies the default block of code in a switch statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

do

A

Used together with while to create a do-while loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

double

A

A data type that can store whole numbers from 1.7e−308 to 1.7e+308

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

else

A

Used in conditional statements to specify a new condition if the first condition is false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

enum

A

Declares an enumerated (unchangeable) type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

exports

A

Exports a package with a module. New in Java 9

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

extends

A

Extends a class (indicates that a class is inherited from another class)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

final

A

A non-access modifier used for classes, attributes and methods, which makes them non-changeable (impossible to inherit or override)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

finally

A

Used with exceptions, a block of code that will be executed no matter if there is an exception or not

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

float

A

A data type that can store whole numbers from 3.4e−038 to 3.4e+038

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

for

A

Create a for loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

if

A

Makes a conditional statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

implements

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

import

A

Used to import a package, class or interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
instanceof
Checks whether an object is an instance of a specific class or an interface
23
interface
Used to declare a special type of class that only contains abstract methods
23
int
A data type that can store whole numbers from -2147483648 to 2147483647
24
long
A data type that can store whole numbers from -9223372036854775808 to 9223372036854775808
25
module
Declares a module. New in Java 9
26
native
Specifies that a method is not implemented in the same Java source file (but in another language)
27
new
Creates new objects
28
package
Declares a package
29
private
An access modifier used for attributes, methods and constructors, making them only accessible within the declared class
30
protected
An access modifier used for attributes, methods and constructors, making them accessible in the same package and subclasses
31
public
An access modifier used for classes, attributes, methods and constructors, making them accessible by any other class
32
requires
Specifies required libraries inside a module. New in Java 9
33
return
Finished the execution of a method, and can be used to return a value from a method
33
short
A data type that can store whole numbers from -32768 to 32767
33
static
A non-access modifier used for methods and attributes. Static methods/attributes can be accessed without creating an object of a class
33
strictfp
Restrict the precision and rounding of floating point calculations
33
switch
Selects one of many code blocks to be executed
33
super
Refers to superclass (parent) objects
33
synchronized
A non-access modifier, which specifies that methods can only be accessed by one thread at a time
33
this
Refers to the current object in a method or constructor
34
throw
Creates a custom error
34
throws
Indicates what exceptions may be thrown by a method
34
transient
A non-accesss modifier, which specifies that an attribute is not part of an object's persistent state
34
try
Creates a try...catch statement
34
var
Declares a variable. New in Java 10
34
void
Specifies that a method should not have a return value
34
volatile
Indicates that an attribute is not cached thread-locally, and is always read from the "main memory"
34
while
Creates a while loop
34
this
Refers to the current object in a method or constructor
34
this
Refers to the current object in a method or constructor
34
int
A data type that can store whole numbers from -2147483648 to 2147483647
34
try
Creates a try...catch statement
34
this
Refers to the current object in a method or constructor
34
int
A data type that can store whole numbers from -2147483648 to 2147483647
34
instanceof
Checks whether an object is an instance of a specific class or an interface
34
float
A data type that can store whole numbers from 3.4e−038 to 3.4e+038
34
try
Creates a try...catch statement
34
int
A data type that can store whole numbers from -2147483648 to 2147483647
34
try
Creates a try...catch statement
34
float
A data type that can store whole numbers from 3.4e−038 to 3.4e+038
34
instanceof
Checks whether an object is an instance of a specific class or an interface
34
this
Refers to the current object in a method or constructor
34
instanceof
Checks whether an object is an instance of a specific class or an interface
34
34
int
A data type that can store whole numbers from -2147483648 to 2147483647
34
try
Creates a try...catch statement
34
static
A non-access modifier used for methods and attributes. Static methods/attributes can be accessed without creating an object of a class
34
float
A data type that can store whole numbers from 3.4e−038 to 3.4e+038
34
this
Refers to the current object in a method or constructor
34
instanceof
Checks whether an object is an instance of a specific class or an interface
34
this
Refers to the current object in a method or constructor
34
int
A data type that can store whole numbers from -2147483648 to 2147483647
34
float
A data type that can store whole numbers from 3.4e−038 to 3.4e+038