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
Q

requires

A

Specifies required libraries inside a module

26
Q

return

A

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

27
Q

static

A

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

28
Q

strictfp

A

restrict the precision and rouding of floating point calculations

29
Q

super

A

refers to superclass (parent) objects

30
Q

switch

A

selects one of many code blocks to be executed

31
Q

synchronized

A

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

32
Q

this

A

refers to the current object in a method or constructor

33
Q

throw

A

creates a custom error

34
Q

throws

A

indicates what exceptions may be thrown by a method

35
Q

transient

A

a non-access modifer which specifies that an attribute is not part of an object’s persistent state

36
Q

try

A

creates a try/catch statement

37
Q

void

A

specifies that a method should not have a return value

38
Q

volatile

A

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