1/41
Vocabulary flashcards covering key terms from GridWorld and basic Java/object-oriented concepts from the notes.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
GridWorld
A Java teaching environment with objects such as Actors, Bugs, Rocks, and Flowers on a grid to illustrate object‑oriented concepts.
CSP-GridWorld.jar
The Java Archive file required to run GridWorld programs.
Workspace
An IDE project organizer used for GridWorld projects.
Object
An entity with data (attributes) and operations (methods) that can manipulate that data.
Class
A blueprint for creating objects; defines data fields and methods.
Actor, Bug, Rock, Flower
GridWorld classes used to construct objects that inhabit the grid.
Parameter
Information a method needs in order to perform its task.
Argument
Actual data passed to a method when it is called.
Method
A sequence of instructions an object follows to perform a task.
Return Value
The information a method produces when it finishes.
Void
A return type indicating that no value is returned.
Constructor
A special method used to create a new object during instantiation.
Instantiation
Creating an object instance from a class using the new keyword.
Location
A grid coordinate class built with a row and a column (e.g., new Location(5, 7)).
Color constants
Color values from java.awt.Color (for example Color.GREEN) used to color objects.
Variable
A storage location in memory with a type, a name, and contents.
int
Primitive numeric type for integers.
double
Primitive numeric type for real numbers.
Declaration
Specifying a variable's type and name (for example, int age;).
Initialization
Assigning an initial value to a declared variable (for example, int age = 17;).
Assignment Operator
The equals sign used to assign a value to a variable ( = ).
Rules for Identifiers
Identifiers may contain letters, digits, underscore, and dollar signs; cannot start with a digit; no spaces; case-sensitive.
Java Naming Conventions (Classes)
Class names start with uppercase and use each word capitalized (PlanoWestWolf).
Java Naming Conventions (Variables/Methods)
Names start with a lowercase letter; subsequent words are capitalized (myDogSpot).
Java Naming Conventions (Constants)
Constants are all uppercase with underscores between words (NUMBER_ONE).
Strings
A sequence of characters; declared with String or new String(…).
String Concatenation
Joining strings with the + operator to form a new string.
String Length
The length() method returns the number of characters in a string.
Comments - Single-line
Single-line comments start with // and are ignored by the compiler.
Comments - Multi-line
Multi-line comments start with /* and end with * / and may span multiple lines.
Javadoc
Documentation comments that start with /** and may include @author, @param, @return tags.
Import Statements
Bring classes from other packages into scope; not needed for java.lang classes; examples include import info.gridworld.actor.Bug;.
Java API
The public interface for classes and methods in the Java library.
Object Reference
A variable that stores the memory address of an object; its type is the class name.
Calling a Method
Syntax: objectName.methodName(parameters); to invoke a method on an object.
Return Method vs Void Method
Return methods provide a value; void methods return no value.
Accessor vs Mutator
Accessor retrieves data without changing the object; mutator changes the object's data.
Overloaded Methods
Multiple methods with the same name but different parameter lists.
BugRunner
A GridWorld program that builds a world, adds objects, and runs the simulation.
world.add(location, actor)
Add an actor to a specific location in the grid; overloaded versions exist.
0-based Indexing
Grid row and column numbers start at 0; (0,0) is the upper-left corner.
Upper-left Corner (0,0)
The origin in a grid where row and column indexing begins at zero.