Reserved Keywords Flashcards
abstract
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.
assert
For debugging -> used to verify that a certain assumption about the program is true. (assert (i == 0))
break
used to break out of a loop or switch block
case
Marks a block of code in switch statement
catch
Catches exceptions generated by try statements
class
Defines a class
continue
Continues to next iteration of a loop
final
Defines a constant -> value is non-changeable, impossible to inherit or override
default
Specifies the default block of code in a switch
statement
do
Used together with while to create a do-while loop
else
used in conditional statements
exports
Exports a package with a module
extends
Extend from parent class
finally
Used with exceptions, block of code that will be executed no matter if there is an exception or not
implements
implements an interface