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

Glossary

D

Dynamic Type

Criticality: 3

The actual type of the object that a variable refers to at runtime, determined by the constructor call. This type dictates which overridden non-static methods are executed.

Example:

In Shape s = new Circle();, Circle is the dynamic type of the object referenced by s.

N

Non-static Method

Criticality: 3

Also known as an instance method, this method belongs to an object instance and operates on that object's data. When called via a variable, its behavior is determined by the object's dynamic type.

Example:

If you have a Dog object myDog, calling myDog.bark() invokes a non-static method specific to that dog instance.

O

Override

Criticality: 3

When a subclass provides its own specific implementation for a method that is already defined in its superclass. This allows for polymorphic behavior.

Example:

A Cat class might override the makeSound() method inherited from Animal to print 'Meow!' instead of 'Generic animal sound'.

P

Polymorphism

Criticality: 3

A core object-oriented programming concept where objects can take on multiple forms, allowing a single variable to refer to objects of different types at different times, influencing method behavior.

Example:

In a game, a Vehicle variable could hold a Car object or a Motorcycle object, demonstrating polymorphism.

S

Static Method

Criticality: 3

A method that belongs to the class itself, not to any specific object instance. It is called using the class name or, if called via an object reference, its behavior is determined by the variable's static type.

Example:

A utility class might have Math.abs(-5) where abs is a static method of the Math class.

Static Type

Criticality: 3

The type that a variable is declared as at compile time. It determines which methods can be called on the variable without compilation errors.

Example:

In Animal myPet = new Dog();, Animal is the static type of the myPet variable.

Superclass

Criticality: 2

A class from which other classes inherit properties and methods. It serves as a parent class in an inheritance hierarchy.

Example:

In a hierarchy where Car and Motorcycle extend Vehicle, Vehicle is the superclass.