Please enable JavaScript to use CodeHS

Latte Glossary

Flashcards

Course:

Module:

Lesson:

Search:

Scope General

In what part of the program the variable exits

Scope

Local variable General

A variable that is restricted to use in a certain scope of a program

Local variable

Class Java

A class is a template, or a blueprint, from which Java objects are created. All Java programs start with a class.

Object Java

An object is a single instance of a Java class. An object has both state and behavior.

Primitive Type Java

Primitive types are the basic, simple data types that are inherent to Java (int, double, char, and boolean)

Static method Java

A method called on the Class, rather than on a specific object of the Class.

Object Oriented Programming Java

Programming model that focuses on **objects** and the data and actions associated with the objects.

State Java

The state of an object is all of the object's associated data. It is the *state* that the object is in.

Behavior Java

The behavior of an object is what the object is able to do. It is the actions that can be performed by the object.

Instance Java

Instance is what you call a specific object constructed from a class. Instance and object generally refer to the same thing. An object is a specific instance of a class.

Client Java

When someone else creates a Class (like `String`, or `Randomizer`), and you are using the functionality of that Class in your program, your program is a *client* of the class. You are using the class as a client.

Instance Variable Java

A variable defined in a Class, for which each object of the class has its own copy.

Constructor Java

A constructor is a special method of a Class that constructs a new object (a new instance) of the Class and sets the initial values for the instance variables.

Instance Method Java

An instance method is a method that defines the behavior of an object. It defines an action that the object can perform.

Visibility Java

Visibility (usually `public` or `private`) defines who has access to something (usually a variable or method). Public means code outside of the class can access, private means only code inside the class can access.

Getter Method Java

An instance method that allows the client to **get** the value of an instance variable on an object.

Setter Method Java

An instance method that allows the client to **set** the value of an instance variable on an object.

Static variable Java

A variable or attribute of a class that is shared between **all** instance of a class. Each instance **does not** get their own copy.

Method Overloading Java

Classes can have multiple methods with the same name, as long as the parameters to those methods are different. Doing this is called "overloading" a method.

Variable Shadowing General

If two variables have the same name, and exist inside of the same scope, the variable with the *more specific* scope takes precedence. This is called shadowing. Local variables and parameters shadow the more general global variables (instance variables).

Package Java

Related classes are grouped together into packages.

this Java

The `this` keyword is a reference to the current object (the current instance).

Class Hierarchy Java

Class hierarchy refers to the arrangement of classes and how they relate to each other.

super Java

The `super` keyword lets us reference the superclass when writing code inside of a subclass.

Method Overriding Java

If a subclass defines a new method body for a method defined in the superclass, then the subclass has **overridden** the method of the superclass.

Abstract Class Java

A class, usually at the top of a Class Hierarchy, that cannot be instantiated, because not all of its methods are defined.

Abstract method Java

A method, written in an Abstract Class, that is not defined. The word `abstract` must come right before the method's return type. It is up to the subclass to fill in the definition for the abstract method.

Polymorphism Java

Polymorphism is the capability of a method to do different things depending on which object it is acting upon.

Interface Java

An interface provides a list of methods that *must* be defined if a class chooses to implement the interface.

Comparable Interface Java

The Comparable Interface is a standard interface in Java that mandates that all classes implementing the Comparable interface must define a method called `int compareTo(Object o)` that returns a positive int if the parameter `o` passed in is *less than* the current instance, returns 0 if it is equal, and a negative int if it is greater.