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

Glossary

C

Calling a Method

Criticality: 3

The act of executing a method by using its name and providing actual values (arguments) for its parameters.

Example:

To use a method that calculates the sum, you would perform calling a method like myCalculator.add(5, 10);.

M

Method

Criticality: 3

A block of code that performs a specific task. It can take inputs (parameters), follow a set of instructions, and produce an output.

Example:

In a game, a movePlayer method might take a direction as input and update the player's position on the screen.

Method Code

Criticality: 1

The set of instructions or statements contained within a method that define the specific task it performs. It's the 'recipe' a method follows.

Example:

Inside a calculateTax method, the method code would include calculations like tax = income * taxRate;.

Method Signature

Criticality: 3

The unique identifier of a method, consisting of its name and the ordered list of its parameter types. It defines how the method can be called.

Example:

The method signature for public static void calculateSum(int num1, int num2) is calculateSum(int, int).

O

Output (of a method)

Criticality: 2

The result produced by a method after it executes its instructions. This can be a returned value, a printed message, or a change in data.

Example:

A method calculateHypotenuse(double a, double b) would return a double value as its output.

Overloading Methods

Criticality: 3

The ability to define multiple methods within the same class that share the same name but have different parameter lists (different types, number, or order of parameters).

Example:

You could have a printShape method that takes a double radius for a circle, and another printShape method that takes double length, double width for a rectangle, demonstrating overloading methods.

P

Parameters

Criticality: 3

Values passed into a method as inputs, allowing the method to perform its task with specific data. They are like the ingredients you give to a recipe.

Example:

A calculateArea method might take length and width as its parameters to compute the area of a rectangle.

V

Void Method

Criticality: 2

A method that performs a task but does not return any value. Its purpose is often to produce a side effect, such as printing to the console or modifying an object's state.

Example:

A printGreeting method that takes a name and simply prints 'Hello, name!' to the console is a void method.