Please enable JavaScript to use CodeHS

Latte Glossary

Flashcards

Course:

Module:

Search:

lowerCamelCase General

`lowerCamelCase` is a naming convention where the first letter is lower case, and each subsequent start of a word is upper case.

lowerCamelCase

World General

A "world" or "Karel World" is a grid that karel lives in.

karel World

Karel General

Karel is a dog who listens to your commands.

Karel

Command Java

A command is an instruction you can give to Karel.

Karel Documentation Java

Documentation for all Karel Commands and Syntax

Curly Bracket General

An open curly bracket is { and a close curly bracket is }

Curly Bracket

The run method Java

The run method is where a Java program begins.

Indentation General

Indentation is the visual structure of how your code is laid out. It uses tabs to organize code into a hierarchy.

Parentheses General

( and )

Parentheses

Method Java

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

Define a method Java

Defining a method means to teach the computer a new command and explain what it should do when receiving that command.

Calling a method Java

Calling a method actually gives the command, so the computer will run the code for that method.

Method body Java

The part of the method that contains the commands

Decomposition General

Decomposition is breaking your program into smaller parts.

Decomposition

Break Down (Decompose) Java

Breaking down (decomposing) your code is splitting it up into several smaller, simpler methods

Read Like a Story Java

Programs that “Read like a story” have good decomposition and make the code easy to follow.

Top Down Design Java

Top down design is a method for breaking a problem down into smaller parts.

Programming Style General

The way your code is written is the style. It covers the aspects of the code that goes beyond whether or not it just works.

Programming Style

Comment Java

A message in your code that explains what is going on.

Precondition Java

Assumptions we make about what must be true before a method is called.

Postcondition Java

What should be true after a method is called

SuperKarel General

SuperKarel is like Karel but already knows how to turnRight() and turnAround()

SuperKarel

Loop General

A loop is a way to repeat code in your program.

Loop

Iterate General

A single run through the instructions contained a loop

Iterate

Increment General

To add to or increase

Increment

For Loop Java

A for loop lets us repeat code a **fixed number of times**.

Counter Java

A variable used to count the number of times an action has been performed.

DRY Principle Java

Otherwise known as Don’t Repeat Yourself, this principle is designed to help eliminate repeated code and reduce the complexity of a solution

While Loop General

Lets us repeat code as long as something is true.

While Loop

Condition General

A condition is code that you put inside an if statement or while-loop.

Condition

Control Structure General

A control structure lets us change the flow of the code.

Control Structure loops if statements

Fencepost Problem General

A problem when using a while loop where you forget one action at the beginning or the end.

Fencepost Problem

If Statement General

An if statement lets you ask a question to the program and only run code if the answer is true.

If Statement

If Else Statement General

Control structure that lets us run either one section of code or another depending on a test.

If Else Statement

boolean Java

`boolean` is a Java type that can either be true or false

Pseudocode General

Pseudocode is a brief explanation of code in plain English.

Pseudocode

Edge Case General

An edge case is a problem in your code that only occurs in extreme situations.

Edge Case

Hello World General

Traditionally the very first program you write when learning a programming language, a program that prints "Hello world" to the user.

System.out.println Java

Java method that lets us print out a line of output to the user

System.out.print Java

Java method that lets us print output to the user, without ending the line printed.

Double Quotes General

The `"` character

Variable Java

A symbol or container that holds a value.

int Java

`int` is a Java type that represents an integer (a whole number)

String Java

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

char Java

`char` is a Java type that represents a single character (a single letter)

double Java

`double` is a Java type that represents a real number with decimal values

Declare a variable Java

Declaring a variable is defining it for the first time.

Initialize a variable Java

Initializing a variable is giving it an initial value, or a starting value.

Assigning to a variable Java

Assigning to a variable is updating the variable's value

Type Java

The type of a variable defines what kinds of values the variable can hold

readLine Java

Java method that lets us read in a line of input from the user as a String

readInt Java

Java method that lets us read in an integer input from the user

readDouble Java

Java method that lets us read in a decimal value input from the user

readBoolean Java

Java method that lets us read in a true or false value input from the user

Decrement General

To subtract from or decrease

decrement

Modulus operator General

The modulus operator (written as % in most programming languages) divides two numbers and returns the remainder.

Integer Division General

When two integers are divided, the decimal values are truncated, or chopped off.

Casting Java

Casting is turning something of one type into another type

Negate General

To flip a boolean value, or take the opposite of a boolean value. If you negate true, you get false. If you negate false, you get true.

And operator Java

Logical operator that ANDs two boolean values. Written as `&&`. `a && b` will be true if both `a` and `b` are true.

Or operator Java

Logical operator that ORs two boolean values. Written as `||`. `a || b` will be true if `a` or `b` is true.

Not operator Java

Logical operator that negates a single boolean value. Written as `!`. `!a` will be true if `a` is false, and false if `a` is true.

Logical Operator Java

Used to make logical associations between boolean values.

Comparison operator General

Used to make comparisons between values.

comparison operator

Infinite Loop General

A loop that has no way of stopping, and will keep looping forever.

Loop-and-a-half Java

A loop, most often set with `while(true)`, that has a `break` statement in the loop body.

Sentinel Java

A constant that has the specific purpose of being the value that breaks out of a loop.

break statement Java

The `break;` statement breaks out of the current loop, without executing any more code in the loop.

Short Circuit Evaluation General

A short cut when evaluating boolean expressions. If the result can be determined solely by the first part of a boolean expression, the second part is not evaluated, it is skipped.

De Morgan's Laws Java

Laws that define how we can negate an AND statement and how we can negate an OR statement

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)

Concatenation Java

Concatenation is another word for combining. Concatenating Strings is when we add Strings together.

Parameter Java

A variable passed into a method from outside the method.

Return statement Java

The `return` statement exits a method and returns a value.

Return value Java

The value returned from a 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.

Call site Java

A method's call site is the point in the code where the method is called.

Java Documentation Java

Documentation showing the syntax and examples for how to use the various features of Java.

Javadoc Java

A specific standard for commenting Java programs. Javadoc is a format to follow when commenting in order to clearly explain your code.

Class Java

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

Substring Java

A substring is a smaller sequence of characters in a larger String.

Immutable Java

Unable to change. Strings in Java are immutable, meaning you can't change it once you make it. If you take a substring of a String, or concatenate something to a String, the result is a *brand new* String, rather than a modification of the original.

Escape Sequence General

Escape sequences are characters with special meanings.

Static method Java

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

Bug General

A bug is a problem in your code.

Bug

Compile Time Error Java

An error in the actual Java code. The code will not **compile** into an executable program, because there are errors in the text of the code.

Compiler Java

A tool that compiles your Java code, it takes the Java code you've written and turns it into an executable program.

Runtime Error Java

An error that happens while the program is running. Even if the code is written with the proper syntax, there are things that can go wrong while the program is running.

Exception Java

An exception is thrown by Java when a **runtime error** is encountered. The exception provides information about what kind of error occurred.

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.

toString Java

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

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.

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

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.

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.

Data Structure Java

A particular way of organizing data in our programs.

Array Java

A data structure that stores a **fixed** number of elements, all of the same type, one after another like a list.

Array Index Java

The position of an element in an array. The first element is at index 0, the second element is at index 1, and so on.

Indexing into an array Java

Getting a value at a particular index in an array.

Array length Java

The number of elements an array can hold. You can get the length of an array `arr` by typing `arr.length`

Iterating over an array Java

Looping through all of the elements of an array

ArrayList Java

ArrayList is a Java class that is like an Array with extra powers. It can automatically resize and comes with other helpful methods.

For Each Loop Java

A for loop that is written differently so that it loops through each element in a data structure, as opposed to having a loop counter variable that goes from 0 to length-1.

List Interface Java

A Java Interface that represents a general List. The interface provides a list of methods that classes should implement if they want to be used as a List.

2D Array Java

A 2D Array is an array of arrays, used to represent tables, grids, and matrices.

Row-major Order Java

The ordering of 2D arrays is row-major order, meaning the first index is the row, and the second index is the col. `arr[2][0]` would access the element on the third row and first column.

Nested For Loop Java

A for loop written, or “nested”, inside of another for loop. For example:

HashMap Java

A data structure that stores key -> value mappings.

Key Java

A key is the value used to look something up in a HashMap

Value (HashMap value) Java

The value is the result you get when you look up a key in a HashMap. It is the value paired with a key.

Number System General

A number system defines how we represent numbers. It defines which digits we can use, and what value each position (place value) in a number has.

Binary General

The binary number system is the Base 2 Number System. It is a number system that only uses 2 digits (0 and 1).

Decimal General

The decimal number system is the Base 10 number system. It is a number system that only uses 10 digits (0 through 9).

Number Base General

The number base of a number system defines how many digits are in the number system, and the base of the exponent for each place value in a number.

Octal General

The octal number system is the Base 8 number system. It is a number system that only uses 8 digits (0 through 7).

Hexadecimal General

The hexadecimal number system is the Base 16 number system. It is a number system that only uses 16 digits (0 1 2 3 4 5 6 7 8 9 A B C D E F)

Bit General

Bit means "binary digit". A bit is a single digit in a binary number. A bit can either be 0 or 1.

Byte General

A byte is 8 bits.

Kilobyte General

A kilobyte (kB) is 2^10 bytes (1024 bytes) of binary data.

Megabyte General

A megabyte (MB) is 2^20 bytes (1024 kB) of binary data.

Gigabyte General

A gigabyte (GB) is 2^30 bytes (1024 MB) of binary data.

Constant Java

A constant is a variable you define at the top of the program that doesn’t change. The reason to define constants is to store named variables that have relevant values for the program.