1/36
Vocabulary flashcards covering Java basics, object-oriented concepts, constructors, inheritance, maps, and lab-specific conventions.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Comment line
A line starting with // that the compiler ignores; used to annotate code.
import
Statement to bring in classes from other packages so you can use them in your program.
class
A blueprint/container for code that defines fields and methods for objects.
main method
The entry point of a Java program: public static void main(String[] args); statements run in order.
Display.openWorld
A class method that loads a map into the graphics window.
Display.setSize
Sets the size of the display window (width by height).
Display.setSpeed
Controls the execution speed of robot actions in the display.
Robot
A class representing a robot; used to create robot objects with new Robot().
instantiation
Creating an object from a class using the new keyword.
object reference
A name that points to an instantiated object (e.g., karel is a reference to a Robot instance).
dot notation
Calling a method on an object using objectName.method().
constructor
A special method that initializes a new object; has the same name as the class and no return type.
super
A call inside a subclass constructor to invoke the superclass constructor and initialize inherited fields.
inheritance
A relationship where a subclass gains fields and methods from a superclass (extends).
isa relationship
Label used in UML to indicate an inheritance (is-a) relationship.
has-a relationship
Label used in UML to indicate composition (has-a); one object contains another.
driver class
A class that contains the main method and drives the program by creating objects and issuing commands.
resource class
A class whose methods must be invoked on instantiated objects; not runnable by itself.
static
Modifier for class methods (not tied to an instance), e.g., main() or Display.setSize().
bytecode
The compiled .class form of Java source that runs on the Java Virtual Machine.
javac
The Java compiler that translates .java files into .class bytecode.
java
The runtime launcher that runs a class by invoking its main method.
identifier
A name for a class, method, or variable; cannot start with a number and is case-sensitive; cannot be a Java keyword.
naming conventions
Class names start with uppercase; methods/variables start with lowercase; constants are ALL CAPS.
Cartesian coordinate system
Maps use coordinates; the bottom-left corner is (1, 1).
Unit1/maps
Folder containing predefined map files used by the labs.
instantiate
To create an instance of a class using new.
definite iteration
Repeating a block a fixed number of times using a for-loop.
for-loop syntax
for (initialization; condition; update) { … } for definite iteration.
actual argument
The value passed to a method when it is called.
formal argument
The parameter in a method signature that receives the actual argument.
default constructor
A no-argument constructor that creates an object in its default state.
four-argument constructor
A constructor that takes four parameters and passes them up to the superclass with super.
no-suitable-constructor error
Compiler error when the arguments do not match any constructor in the class hierarchy.
one-argument constructor
A constructor that takes a single parameter to initialize a field.
class method
A method defined as static; belongs to the class, not to any object.
arena map
A specific 10x10 map used in Lab04 for demonstrations.