zuai-logo

Glossary

C

Class

Criticality: 3

A blueprint or template that defines the structure (data) and behavior (methods) for objects of a certain type.

Example:

The Car class defines that all car objects will have a make, model, and a startEngine() method.

Constructor

Criticality: 3

A special method within a class used to create new objects (instances) of that class and initialize their instance variables.

Example:

new Book("The Hobbit", "J.R.R. Tolkien") calls the constructor to create a new Book object with a title and author.

D

Dot operator (.)

Criticality: 3

Used to access the instance variables or call the methods of a specific object.

Example:

myCar.getModel() uses the dot operator to call the getModel() method on the myCar object.

I

Instance

Criticality: 3

A specific, concrete object created from a class blueprint. Each instance has its own unique set of data based on the class's definition.

Example:

If Dog is a class, then myDog created as new Dog("Buddy") is an instance of the Dog class.

Instance Variables

Criticality: 3

Variables declared within a class but outside any method, representing the characteristics or data unique to each object (instance) of that class.

Example:

In a Dog class, String breed; and int age; would be instance variables for each individual dog object.

M

Methods

Criticality: 3

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

Example:

A Robot object might have a move() method to change its position or a chargeBattery() method.

O

Object Instantiation

Criticality: 3

The process of creating a new object (an instance) from a class using the `new` keyword and a constructor.

Example:

The line Student alice = new Student("Alice", 18, 3.5); demonstrates object instantiation, creating the alice object.

Objects

Criticality: 3

Complex entities in Java programs that hold data and perform actions. They are specific instances created from a class blueprint.

Example:

In a video game, a Player object might store health and score, and have methods to move or attack.

P

Primitive Types

Criticality: 2

Basic data types in Java that store the actual data value directly in memory, such as integers, floating-point numbers, and boolean values.

Example:

int score = 100; declares score as a primitive type variable, directly storing the value 100.

R

Reference Type

Criticality: 2

A data type that stores the memory location (address) of the actual data, rather than the data itself. Objects are reference types.

Example:

When you declare String name = "Alice";, name is a reference type variable holding the address of "Alice" in memory.

n

new keyword

Criticality: 3

Used in Java to create a new object (an instance) of a specified class by allocating memory for it and calling its constructor.

Example:

Circle myCircle = *new* Circle(5.0); uses the new keyword to create a new Circle object.