zuai-logo

Home

Leaderboard

    Learn
zuai-logo
  1. AP Computer Science A
FlashcardFlashcardStudy GuideStudy GuideQuestion BankQuestion BankGlossaryGlossary

Glossary

E

Enhanced for loop

Criticality: 3

A simplified loop structure in Java used to iterate over elements of arrays or collections without needing an explicit index.

Example:

To print all scores in an int[] scores array, you could use for (int score : scores) { System.out.println(*score*); }.

M

Mutator methods

Criticality: 2

Methods in a class that are designed to change the state or values of an object's instance variables. They typically start with 'set' (e.g., `setName`).

Example:

A Car object might have a public void *setColor*(String newColor) method to change its paint.

O

Object reference

Criticality: 3

A variable that stores the memory address of an object, allowing access to that object's data and methods. When an object is passed, its reference (a copy of the address) is passed.

Example:

When you declare Student s1 = new Student();, s1 is an object reference pointing to the actual Student object in memory.

P

Pass-by-value

Criticality: 3

A mechanism in Java where arguments are passed to methods as copies of their actual values. Changes made to the parameter inside the method do not affect the original variable.

Example:

If you pass an int x = 5; to a method void change(int num) { num = 10; }, after the call, x will still be 5, not 10, because num was a copy.

T

Traverse

Criticality: 2

To visit or process each element within a data structure, such as an array or an ArrayList, typically in a specific order.

Example:

An algorithm might traverse a list of student names to find the one with the highest GPA.