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
Q

instanceof

A

Checks whether an object is an instance of a specific class or an interface

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

interface

A

Used to declare a special type of class that only contains abstract methods

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

int

A

A data type that can store whole numbers from -2147483648 to 2147483647

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

long

A

A data type that can store whole numbers from -9223372036854775808 to 9223372036854775808

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

module

A

Declares a module. New in Java 9

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

native

A

Specifies that a method is not implemented in the same Java source file (but in another language)

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

new

A

Creates new objects

28
Q

package

A

Declares a package

29
Q

private

A

An access modifier used for attributes, methods and constructors, making them only accessible within the declared class

30
Q

protected

A

An access modifier used for attributes, methods and constructors, making them accessible in the same package and subclasses

31
Q

public

A

An access modifier used for classes, attributes, methods and constructors, making them accessible by any other class

32
Q

requires

A

Specifies required libraries inside a module. New in Java 9

33
Q

return

A

Finished the execution of a method, and can be used to return a value from a method

33
Q

short

A

A data type that can store whole numbers from -32768 to 32767

33
Q

static

A

A non-access modifier used for methods and attributes. Static methods/attributes can be accessed without creating an object of a class

33
Q

strictfp

A

Restrict the precision and rounding of floating point calculations

33
Q

switch

A

Selects one of many code blocks to be executed

33
Q

super

A

Refers to superclass (parent) objects

33
Q

synchronized

A

A non-access modifier, which specifies that methods can only be accessed by one thread at a time

33
Q

this

A

Refers to the current object in a method or constructor

34
Q

throw

A

Creates a custom error

34
Q

throws

A

Indicates what exceptions may be thrown by a method

34
Q

transient

A

A non-accesss modifier, which specifies that an attribute is not part of an object’s persistent state

34
Q

try

A

Creates a try…catch statement

34
Q

var

A

Declares a variable. New in Java 10

34
Q

void

A

Specifies that a method should not have a return value

34
Q

volatile

A

Indicates that an attribute is not cached thread-locally, and is always read from the “main memory”

34
Q

while

A

Creates a while loop

34
Q

this

A

Refers to the current object in a method or constructor

34
Q

this

A

Refers to the current object in a method or constructor

34
Q

int

A

A data type that can store whole numbers from -2147483648 to 2147483647

34
Q

try

A

Creates a try…catch statement

34
Q

this

A

Refers to the current object in a method or constructor

34
Q

int

A

A data type that can store whole numbers from -2147483648 to 2147483647

34
Q

instanceof

A

Checks whether an object is an instance of a specific class or an interface

34
Q

float

A

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

34
Q

try

A

Creates a try…catch statement

34
Q

int

A

A data type that can store whole numbers from -2147483648 to 2147483647

34
Q

try

A

Creates a try…catch statement

34
Q

float

A

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

34
Q

instanceof

A

Checks whether an object is an instance of a specific class or an interface

34
Q

this

A

Refers to the current object in a method or constructor

34
Q

instanceof

A

Checks whether an object is an instance of a specific class or an interface

34
Q
A
34
Q

int

A

A data type that can store whole numbers from -2147483648 to 2147483647

34
Q

try

A

Creates a try…catch statement

34
Q

static

A

A non-access modifier used for methods and attributes. Static methods/attributes can be accessed without creating an object of a class

34
Q

float

A

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

34
Q

this

A

Refers to the current object in a method or constructor

34
Q

instanceof

A

Checks whether an object is an instance of a specific class or an interface

34
Q

this

A

Refers to the current object in a method or constructor

34
Q

int

A

A data type that can store whole numbers from -2147483648 to 2147483647

34
Q

float

A

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