Please enable JavaScript to use CodeHS

Latte Glossary

Flashcards

Course:

Module:

Lesson:

Search:

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.

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.

Method Java

A method is a way to teach the computer a new command

String Java

String is a Java type that represents a string of characters (text)

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.

toString Java

toString is a special method you write in your class that returns a String representation of the object.

Parameter Java

A variable that receives a value passed into a method from outside the method.

Return type Java

A method's return type is the type of value returned from that method.

Method signature Java

A method's signature is the name of the method and the parameter list.

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 method Java

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

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.

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

Variable Java

A symbol or container that holds a value.

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).

Primitive Type Java

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

Pointer Java

When an object is assigned to a variable, the variable doesn't hold all of the object's data, it only holds a *pointer* to the object's data. The variable holds a memory location (think of it as a pointer to that memory location), and the object data is stored at that memory location.

Null Pointer Java

Before an object variable is initialized, it doesn't point to any memory. It holds a **null pointer**.

Class Hierarchy Java

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

Subclass Java

If a class A extends the class B, then A is a subclass of B.

Superclass Java

If a class A extends the class B, then B is the superclass of A.

Inheritance Java

When a subclass extends a superclass, the subclass inherits all of the static methods, static variables, and public instance methods of the superclass. This is called inheritance.

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.

Dynamic Binding Java

Also called late binding, this refers to Java choosing the proper method to call at run time, as opposed to at compile time.

Method body Java

The part of the method that contains the commands

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.