Using Objects - Unit 2 (Video)

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/41

flashcard set

Earn XP

Description and Tags

Vocabulary flashcards covering key terms from GridWorld and basic Java/object-oriented concepts from the notes.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

42 Terms

1
New cards

GridWorld

A Java teaching environment with objects such as Actors, Bugs, Rocks, and Flowers on a grid to illustrate object‑oriented concepts.

2
New cards

CSP-GridWorld.jar

The Java Archive file required to run GridWorld programs.

3
New cards

Workspace

An IDE project organizer used for GridWorld projects.

4
New cards

Object

An entity with data (attributes) and operations (methods) that can manipulate that data.

5
New cards

Class

A blueprint for creating objects; defines data fields and methods.

6
New cards

Actor, Bug, Rock, Flower

GridWorld classes used to construct objects that inhabit the grid.

7
New cards

Parameter

Information a method needs in order to perform its task.

8
New cards

Argument

Actual data passed to a method when it is called.

9
New cards

Method

A sequence of instructions an object follows to perform a task.

10
New cards

Return Value

The information a method produces when it finishes.

11
New cards

Void

A return type indicating that no value is returned.

12
New cards

Constructor

A special method used to create a new object during instantiation.

13
New cards

Instantiation

Creating an object instance from a class using the new keyword.

14
New cards

Location

A grid coordinate class built with a row and a column (e.g., new Location(5, 7)).

15
New cards

Color constants

Color values from java.awt.Color (for example Color.GREEN) used to color objects.

16
New cards

Variable

A storage location in memory with a type, a name, and contents.

17
New cards

int

Primitive numeric type for integers.

18
New cards

double

Primitive numeric type for real numbers.

19
New cards

Declaration

Specifying a variable's type and name (for example, int age;).

20
New cards

Initialization

Assigning an initial value to a declared variable (for example, int age = 17;).

21
New cards

Assignment Operator

The equals sign used to assign a value to a variable ( = ).

22
New cards

Rules for Identifiers

Identifiers may contain letters, digits, underscore, and dollar signs; cannot start with a digit; no spaces; case-sensitive.

23
New cards

Java Naming Conventions (Classes)

Class names start with uppercase and use each word capitalized (PlanoWestWolf).

24
New cards

Java Naming Conventions (Variables/Methods)

Names start with a lowercase letter; subsequent words are capitalized (myDogSpot).

25
New cards

Java Naming Conventions (Constants)

Constants are all uppercase with underscores between words (NUMBER_ONE).

26
New cards

Strings

A sequence of characters; declared with String or new String(…).

27
New cards

String Concatenation

Joining strings with the + operator to form a new string.

28
New cards

String Length

The length() method returns the number of characters in a string.

29
New cards

Comments - Single-line

Single-line comments start with // and are ignored by the compiler.

30
New cards

Comments - Multi-line

Multi-line comments start with /* and end with * / and may span multiple lines.

31
New cards

Javadoc

Documentation comments that start with /** and may include @author, @param, @return tags.

32
New cards

Import Statements

Bring classes from other packages into scope; not needed for java.lang classes; examples include import info.gridworld.actor.Bug;.

33
New cards

Java API

The public interface for classes and methods in the Java library.

34
New cards

Object Reference

A variable that stores the memory address of an object; its type is the class name.

35
New cards

Calling a Method

Syntax: objectName.methodName(parameters); to invoke a method on an object.

36
New cards

Return Method vs Void Method

Return methods provide a value; void methods return no value.

37
New cards

Accessor vs Mutator

Accessor retrieves data without changing the object; mutator changes the object's data.

38
New cards

Overloaded Methods

Multiple methods with the same name but different parameter lists.

39
New cards

BugRunner

A GridWorld program that builds a world, adds objects, and runs the simulation.

40
New cards

world.add(location, actor)

Add an actor to a specific location in the grid; overloaded versions exist.

41
New cards

0-based Indexing

Grid row and column numbers start at 0; (0,0) is the upper-left corner.

42
New cards

Upper-left Corner (0,0)

The origin in a grid where row and column indexing begins at zero.