Glossary

A

Abstraction

Criticality: 2

The concept of hiding the complex implementation details and showing only the essential features of an object. It focuses on 'what' an object does rather than 'how' it does it.

Example:

When you use a remote control, you press a button to change the channel without needing to know the intricate electronic processes happening inside the TV; this is an example of abstraction.

C

Class

Criticality: 3

A blueprint or template that defines the structure and behavior for creating objects. It specifies the attributes and methods that objects of that class will possess.

Example:

Before you can create individual Car objects, you first need to define the Car class, specifying it has attributes like color and speed, and methods like accelerate().

Constructor

Criticality: 3

A special method used to initialize a newly created object of a class. It has the same name as the class and does not have a return type.

Example:

When you write Dog myDog = new Dog("Buddy");, Dog("Buddy") is calling the constructor to set up the new Dog object's initial state.

E

Encapsulation

Criticality: 2

The bundling of data (attributes) and methods (behaviors) that operate on the data into a single unit, or class. It also involves restricting direct access to some of an object's components.

Example:

A BankAccount class might keep the balance private and only allow changes through deposit() or withdraw() methods, demonstrating encapsulation.

I

Inheritance

Criticality: 3

A mechanism where one class acquires the properties and behaviors of another class. It promotes code reusability and establishes an 'is-a' relationship between classes.

Example:

A Car class can inherit properties like speed and color from a more general Vehicle class, avoiding redundant code.

M

Math class

Criticality: 2

A built-in Java class in the `java.lang` package that provides static methods for performing common mathematical operations.

Example:

To calculate the square root of a number, you would use double result = **Math.sqrt**(25.0); which would store 5.0 in result.

Methods

Criticality: 3

Blocks of code that perform specific tasks within a class. They define the behaviors or actions that objects of that class can perform.

Example:

A Robot object might have a moveForward() method that makes it advance, or a scanArea() method to detect obstacles.

O

Object-Oriented Programming (OOP)

Criticality: 3

A programming paradigm based on the concept of 'objects', which can contain data and code. Java is an OOP language.

Example:

In a game, designing characters like a 'Player' or 'Enemy' using Object-Oriented Programming allows you to define their properties (health, score) and actions (move, attack) within distinct, reusable units.

Objects

Criticality: 3

Specific instances of a class, representing real-world entities or concepts. They encapsulate data (attributes) and behavior (methods).

Example:

If Dog is a class, then myDog and yourDog are individual objects of the Dog class, each with its own name and breed.

P

Polymorphism

Criticality: 3

The ability of an object to take on many forms. In Java, it allows objects of different classes to be treated as objects of a common superclass.

Example:

A draw() method could behave differently for a Circle object versus a Square object, even though both are treated as a generic Shape through polymorphism.

R

Reference types

Criticality: 2

Data types that store memory addresses of objects rather than the actual data values themselves. Objects in Java are reference types.

Example:

When you declare String name = "Alice";, the variable name doesn't hold "Alice" directly, but rather a memory address pointing to where "Alice" is stored, making String a reference type.

S

String class

Criticality: 3

A built-in Java class that represents sequences of characters. String objects are immutable, meaning their value cannot be changed after creation.

Example:

You can check the length of a user's input using String userInput = "Hello"; int len = userInput.**length**();

W

Wrapper Classes

Criticality: 2

Classes in Java that provide a way to use primitive data types (like `int`, `char`, `boolean`) as objects. They allow primitive values to be stored in collections that only hold objects.

Example:

While int is a primitive, Integer is its Wrapper Class, allowing you to store an integer value in an ArrayList<Integer>.

n

new keyword

Criticality: 3

An operator in Java used to create a new instance of a class (an object) and allocate memory for it.

Example:

To create a new Scanner object to read user input, you would use Scanner input = **new** Scanner(System.in);