Reserved Keywords Flashcards

1
Q

abstract

A

a non-access modifer. Used for classes and methods: an abstract class cannot be used to create objects -> (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.

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

assert

A

For debugging -> used to verify that a certain assumption about the program is true. (assert (i == 0))

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

break

A

used to break out of a loop or switch block

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

case

A

Marks a block of code in switch statement

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

catch

A

Catches exceptions generated by try statements

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

class

A

Defines a class

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

continue

A

Continues to next iteration of a loop

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

final

A

Defines a constant -> value is non-changeable, impossible to inherit or override

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
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
10
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
11
Q

else

A

used in conditional statements

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

exports

A

Exports a package with a module

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

extends

A

Extend from parent class

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

finally

A

Used with exceptions, 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
15
Q

implements

A

implements an interface

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

import

A

used to import a package, class or interface

17
Q

instanceof

A

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

18
Q

native

A

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

19
Q

new

A

Creates new objects

20
Q

module

A

Declares a module

21
Q

package

A

declares a package (Basically a folder used to group classes)

22
Q

private

A

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

23
Q

protected

A

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

24
Q

public

A

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

25
requires
Specifies required libraries inside a module
26
return
Finished the execution of a method, and can be used to return a value from a method
27
static
non-access modifier used for methods and attributes, static methods/attributes can be accessed without creating an object of a class
28
strictfp
restrict the precision and rouding of floating point calculations
29
super
refers to superclass (parent) objects
30
switch
selects one of many code blocks to be executed
31
synchronized
a non access modifier, rwhich specifies that methods can only be accessed by one thread at a time
32
this
refers to the current object in a method or constructor
33
throw
creates a custom error
34
throws
indicates what exceptions may be thrown by a method
35
transient
a non-access modifer which specifies that an attribute is not part of an object's persistent state
36
try
creates a try/catch statement
37
void
specifies that a method should not have a return value
38
volatile
indicates that an attribute is not cached thread-locally, and is always read from the "main memory"