Please enable JavaScript to use CodeHS

Nitro Glossary

Flashcards

Course:

Module:

Search:

String Java

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

String Literals Java

A sequence of characters enclosed in double quotations “ “.

Java Main Skeleton Java

Includes the class and main method arguments. Must include both in order to run successfully.

public static void main(String args[]) Java

Main method. Code to be run must be placed within the main method.

public class MyProgram Java

Class. The name of MyProgram must match the name of the file.

System.out.print Java

Displays output on the computer monitor.

System.out.println Java

Displays output on the computer monitor and moves cursor to next line.

Variable General

A symbol or container that holds a value.

variable

int Java

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

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.

Primitive Type Java

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

Boolean Java

A boolean is a true or false value.

Reference Type Java

Reference variables store the address of the value

final Java

Prevents variables from changing value.

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.

Order of Operations Java

The order in which mathematical expressions should be evaluated. Starts with Parentheses, Exponents, Multiplications and Division, Addition and Subtraction.

Literal Java

The fixed value being assigned to a variable. Often primitive data types.

ArithmeticException Java

Exception that is thrown to warn programmers about arithmetic errors in their code.

Increment Java

Increase the value of a variable by one. variable++;

Decrement Java

Decrease the value of a variable by one. variable--;

Compound Assignment Operators Java

Allows programmers to shortcut variable assignments that include the variable being assigned a new value: x = x + y; shortcut: x += y;

Casting Java

Turning something of one type into another type!

Implicit Casting Java

When Java automatically casts the value correctly without the programmer needing to do so

(int)(x + 0.5) Java

Rounds the value of a double to the nearest whole number.

Integer.MAX_VALUE Java

The highest value Java is able to access. 2147483647

Overflow Java

When a calculation relies on a number outside the acceptable number range, Java will wrap back to the MIN or MAX value depending on the value.

variable.nextLine() Java

Allows users to input String values.

variable.nextInt() Java

Allows users to input int values.

variable.nextDouble() Java

Allows users to input double values.

Package Java

Packages are used to group code into a folder for easy use.

Scanner class Java

A class within java.util. It contains code specifically designed to help with user input.

Class Java

Classes are the template through which objects are created. It is the formal blueprint for creating objects.

Object Java

An object is a variable of a data type that is user defined. Every object has a state and a behavior.

Instance Java

A created object with defined attributes.

State Java

The data that is associated with an object or class.

Behavior Java

The actions that can be completed by an object or class.

Object Oriented Programming Java

The use of object and class types in programming.

Instance Variables Java

Used to store the state, or data of the object instances.

Constructor/Signature Java

Allows for the creation of a new object. Consists of the constructor name and parameter list.

new Java

Necessary keyword for instantiating a new class object.

Instantiate Java

Create an instance of a class object.

Formal and Actual Parameters Java

Formal parameters are the parameters outlined in the parameter list in the constructor, while actual parameters are the parameters that are input when a new instance of a class object is created.

Method Java

Procedures that allow us to control and define the behavior of an object.

Access Specifier Java

Determines who has access to using the method when writing classes and objects.

Return Type Java

Indicates what type value is being returned from the method

Calling a Method Java

objectName.method()

Procedural Abstraction Java

The ability to use methods and programs that we do not fully understand, or are unable to write.

Method overloading Java

Methods can have multiple signatures. Java will use the correct signature based on the actual parameters used in a program.

return keyword Java

Used to return a value back to the main program from a method.

Scope Java

Defines which part of the program a variable can be accessed from.

Immutable Java

Unable to be changed or manipulated. String are immutable.

Concatenation Java

The process of adding two String values together. This creates a new String object. Primitives can be concatenated with String objects.

Implicit Conversion Java

The automatic process of transforming a variables data type. This occurs when a primitive and String object are concatenated by changing the primitive value to a String object type.

Escape Sequences Java

Enable users to use special characters and actions within String objects.

String(String str) constructor Java

Constructs a new String object that represents the same sequence of characters as str

int length() Java

Returns the number of characters in a String object

String substring(int from, int to) Java

Returns the substring beginning at index from and ending at index to − 1

String substring(int from) Java

Returns substring(from, length())

IndexOutOfBoundsException Java

A String object has index values from 0 to length – 1. Attempting to access indices outside this range will result in this error.

int indexOf(String str) Java

Returns the index of the first occurrence of str; returns -1 if not found

int compareTo(String other) Java

Returns a value < 0 if this is less than other; returns zero if this is equal to other; returns a value > 0 if this is greater than other

Application Programming Interfaces Java

APIs and libraries simplify complex programming tasks by providing sets of clearly defined methods of communication among various computing components.

Documentation Java

Documentation is the reference for how to use different methods and classes

Static Methods Java

Static methods are the methods in Java that can be called without creating an object of class. Static methods are called using the dot operator along with the class name unless they are defined in the enclosing class.

Math Class Java

The Math class is part of the java.lang package and contains only static methods.

int abs(int x) Java

Returns the absolute value of an int value

double abs(double x) Java

Returns the absolute value of a double value

double pow(double base, double exponent) Java

Returns the value of the first parameter raised to the power of the second parameter

double sqrt(double x) Java

Returns the positive square root of a double value

double random() Java

Returns a double value greater than or equal to 0.0 and less than 1.0

Math.random Java

Can be manipulated to produce a random int or double in a defined range.

Integer(int value) and Double(double value) Java

Constructs a new Integer object or a new Double Object that represents the specified int or double value

Integer and Double Classes Java

These classes are part of the java.lang package and Object class and have a number of useful methods.

Integer.MIN_VALUE and Integer.MAX_VALUE Java

The minimum/maximum value represented by an int or Integer, which are -2147483648 and 2147483647

int intValue() and double doubleValue() Java

Returns the value of this Integer as an int and this Double as a double

Autoboxing Java

Automatic conversion between primitive types and their corresponding object wrapper classes

Unboxing Java

Reverse of autoboxing; automatic conversion from the wrapper class to the primitive type

null Java

A keyword that indicates a reference object doesn’t point to any object data.

Overloading Java

When a class has more than one constructor with the same name, but different parameter lists.

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

Control Structure General

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

Control Structure loops if statements

Conditional Statement General

A statement that evaluates to true or false.

Relational Operators Java

== , !=. <. > , <=, >= These allow for the comparison or primitive type values. The result of these expressions can be stored as a Boolean value.

If Else Statement General

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

If Else Statement

else statement Python

Executes code only if all conditions are false

Condition General

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

Condition

else if Statement General

A statement that executes if the previous statements are false and this statement is true

Logical Operators Java

Can be used to connect boolean expressions to make more complex expression. NOT ! AND && OR ||

Short Circuit Evaluation Java

When the result of a logical expression using && or || can be determined by evaluating only the first Boolean operand, the second is not evaluated.

Nested if Statements Java

The process of placing if statements within if statements.

Truth Tables Java

A truth table is a table used in logic for comparing Boolean expressions.

Aliases Java

Two object references are considered aliases when they both reference the same object.

Reference equality Java

Equality operator (==) compares the references (addresses in memory) of 2 objects

Logical equality Java

Compares the data of the objects instead of the value of the references. Uses the .equals() method.

Infinite loops Java

Occurs when the expression in a while loop never evaluates to false. The program continues to run infinitely.

break Java

Breaks out of a while loop and executes statements that immediately follow while loop.

return Java

Keyword used in methods to return a value back to the initial program that called the method.

Off by One Error Java

When a for loop iteration is off by one too many or one too few.

charAt(int index) Java

charAt(int index) returns the character at the specified index.

Nested Loops Java

When a loop is placed within another loop. The total number of runs for a nested loop will be the outer loop * inner loop.

Algorithm Java

Step-by-step process that solves a problem.

Statement execution count Java

The number of times a statement is executed by the program.

Big-O Notation Java

A way to represent how long an algorithm will take to execute. It helps to determine how efficient different approaches to solving a problem are.

public Java

Allows access to data and methods from classes outside the declaring class.

private Java

Restricts access to data and methods to the declaring class.

Encapsulation Java

The process of hiding the implementation details of a class from the user

Accessor Methods Java

Methods used to access instance variable and object data. Also referred to as getter methods.

Mutator Methods Java

Methods used to change or manipulate instance variable or object data. Also referred to as setter methods.

alias Java

A variable that references an existing object. When the alias variable is manipulated, so is the original object, and vice versa.

“Has-a” Relationship Java

Objects are defined by having the attributes, or instance variables that they are assigned.

Preconditions Java

Conditions that must be true prior to execution in order for that code segment to behave as expected.

Postconditions Java

Conditions that must be true after the code segment is executed.

Accessor Method Java

A method that enables user to obtain information about an object’s instance and static variables.

toString Method Java

A specific accessor method that returns a String value with information about an object’s instance values. This overrides the object’s inherit toString method when an object is printed using System.out.print or System.out.println

Mutator Method Java

A method that enables user to change the value of an object’s instance and static variables.

object.instanceVariable Java

Instance variables can be accessed directly by using the reference variable name + . + the instance variable name. This only works within the class file if the instance variables are set to private.

Static Variables Java

Variables that can be accessed by all objects of a class. They are called using the class name, and can be used in static and non-static methods.

Static Methods Java

Methods that can be used directly by the class name. They cannot access instance variables or non-static methods.

Method Decomposition Java

The process of breaking down large problems into smaller problems, each with a method that defines a subproblem in the larger problem.

Shadowing Java

If two variables within the same scope have the same name, the variable with the more specific scope will be called.

Local Variable Java

A variable that is defined in a method or constructor. It only exists in the context of the method that it belongs to.

this Keyword Java

Makes a call to the current object in a class file. Allows programmers to specify which objects and instance variables should be called.

ACM Java

Association for Computing Machinery: organization for computing professionals to provide guidance related to ethics and responsibilities.

System reliability Java

When all programs and code will work as intended.

Bias Java

Prejudice in favor of or against one thing, person, or group compared with another, usually in a way considered to be unfair.

Array Java

Arrays are lists that store many values of the same type

Index Java

Array values are stored at a particular index and we access elements in the array by referencing this index value. Index values in Arrays start a 0.

array.length Java

Returns the length of the array

array[index] Java

Accesses an element in the array to either update or retrieve.

Traversing an Array Java

Traversing an array is the process to loop through an array and access each of the elements. Caution must be taken to avoid looping beyond the valid index values.

Enhanced For Loop Java

A loop that is an alternate to a for or while loop that accesses each value in an array starting at the first value and proceeding in order.

Enhanced For Loop Variable Java

Variable created in the enhanced for loop header that contains a copy of the array variable.

Common Array Algorithms Java

Algorithms that are often used in computer science to do basic analysis on a list. These often include traversing and selection processing.

ArrayLists Java

A mutable list of object references. We can create ArrayLists by using the constructor new ArrayList<E>().

ArrayLists Java

A mutable list of object references. We can create ArrayLists by using the constructor new ArrayList<E>().

ArrayList Methods Java

Methods used to alter the state of an ArrayList

ConcurrentModificationException Java

A common error that occurs when attempting to modify an ArrayList while using an enhanced for loop.

Traversing an ArrayList Java

Traversing an ArrayList is the process to loop through an ArrayList and access each of the elements. Caution must be taken to avoid looping beyond the valid index values.

Algorithm General

An algorithm is a set of steps or rules to follow to solve a particular problem.

algorithm, process

Simultaneously Traversal General

Traversing two lists at the same time using the same index often to compare.

Linear Search Java

An algorithm that searches data sets in a sequential order, checking each value from the 0th index to the end of the data set to see what index a specific element can be located at.

Selection Sort Java

A sorting algorithm that swaps the minimum value left in an array with the current array index.

Insertion Sort Java

A sorting algorithm that shifts the already sorted section of an array to place the current array value in the correct index.

Network Protocols Java

Protocols for data sharing on the internet that define rules and conventions for communication between network devices.

Data Privacy Java

The appropriate use of data based on circumstances

Data Security Java

The integrity, confidentiality, and availability of data

2D Array Java

Arrays that store arrays. The methods associated with these are the same as regular arrays.

Row Major Order Java

The process of traversing a 2D array by accessing all elements in a row before moving on to the next row.

Column Major Order Java

The process of traversing a 2D array by accessing all values at the first column in every row, before moving to the next column

Superclass Java

A parent class that contains common attributes and behaviors used by subclasses (children).

Subclass Java

A child class that inherits attributes and behaviors from a superclass (parent).

Is A Java

A relationship between two items that represent a superclass / subclass relationship

Has A Java

A relationship between two items that represents an instance variable relationship.

Super Java

A Java keyword used to refer to the superclass object. In this lesson we saw it used to call the superclass constructor.

Override Java

Override a method occurs when a subclass has the same method signature as a superclass. When a method is overridden, Java uses the method from the subclass.,

@Override Java

Java key term used to denote the user intendeds to override a method.

super Java

A Java keyword used to refer to the superclass object. In this lesson we saw it used to call the superclass constructor and other methods from the superclass.

Polymorphism Java

An object can take on different forms depending on its implementation. Java can call the correct method even when an object is disguised as a more generic reference type

Polymorphism Java

An object can take on different forms depending on its implementation. Java can call the correct method even when an object is disguised as a more generic reference type

Object Superclass Java

The Object class is the superclass of all other classes in Java.

Recursion Java

An iterative process where a method calls itself.

Base Case Java

The simplest version of our recursive process. This is the point when the problem cannot be reduced any further.

Sequential / Linear Search Java

A search technique that starts at the first element and goes through each element until it finds the target value.

Binary Search Java

A search that starts at the middle of a sorted array or ArrayList and eliminates half of the array or ArrayList in each iteration until the desired value is found or all elements have been eliminated.

Merge Sort Java

Merge sort is a recursive sorting algorithm that can be used to sort elements in an array or ArrayList.

Class Java

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

Method Java

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

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.

GUI (graphical user interface) General

A type of interface that uses interactive graphical elements such as windows, buttons, and icons.

Black box programming General

when programs are used and tested without the user necessarily understanding how each part of the program is working, but are able to understand what the final output or product will be.

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.

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.

Steganography General

The art and science of concealing secret messages in such a way that no one apart from the intended recipient knows about the existence of the message. In digital information, Steganography is the practice of concealing a file, message, image, or video within another file, message, image, or video.

Static method Java

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

Bit General

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

RGB Color Encoding General

The RGB encoding scheme allows us to encode colors as numeric data. It defines the amount of Red, Green, and Blue light in a pixel. Each color channel can have a value between 0 and 255.

Pixel General

Images are made up of pixels, which are essentially a grid of values. Each value, or pixel, encodes the color at that position in the image.

Encode General

The process of converting information or data into a specific format that can be understood or processed by a computer.

Parameter Java

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

Data Structure Java

A particular way of organizing data in our programs.

2D Array Java

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

Base Case General

The base case is the simplest form of the recursive problem. The base case can be immediately solved without breaking the problem down any further.