AP Computer Science A

algorithm

a set of instructions for a task

hardware

computer machinery

software

computer programs for tasks

operating system

a program that manages system-level tasks a computer performs

Interactive Development Environment

a programming environment that includes an editor, debugger, and compiler

user interface

the way a user interacts with a computer program

source code

program statements written in a high-level language

string literal

one or more characters enclosed in double quotation marks

post-mortem review

analysis of the progress of the project and successes and failures

operand

a value or variable that is operated on in an arithmetic expression

operator

a symbol specifying a mathematical or logical operation

unary operators

an operator with one argument

modulus

the remainder after performing division when the % sign is used in an arithmetic expression

concatenation

an operation which combines two strings into one

assignment operator

the = symbol which is used to store a value in a variable

variable

a symbol that represents a value and identifies its storage location in memory

primitive data types

a data type defined by a programming language;
e.g. int, double

reference variables

a data type whose instances are not stored directly in that type

instance

a specific realization of any object

int data type

a primitive data type that represents integer values

assignment

instructs the computer to do something

data type declaration

declares the data type of a variable;
e.g. int a;

numeric literal

a character string selected from digits and operators

base-2 representation

binary -- (0, 1)

base-8 representation

octal -- (0, 1, 2, 3, 4, 5, 6, 7)

base-10 representation

decimal -- (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)

base-16 representation

hexadecimal -- (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f);
begins with 0x

double data type

a primitive data type that represents floating point decimal values

floating point number

numbers written using a decimal point

char data type

handles single keyboard characters

boolean data type

restricted to logical values (true/false)

Java primitive data types

1) double
2) int
3) float
4) long
5) short
6) boolean
7) byte
8) char

casting

the process of changing the value of one data type into a value of another data type

evaluation

the process of determining the value of an expression

grouping symbols in Java

parentheses -- ( and )

floor

the greatest integer less than or equal to the floating point number

byte

a sequence of 8 bits used to encode a single character

assignment conversion

occurs when a value with less precision is assigned to a variable with greater precision; widening conversion (narrowing conversion is not possible w/ this method)
e.g. double x = 100;

arithmetic promotion

occurs automatically in an expression of mixed types;
e.g. double x = 3.14
10
10; (10s become 10.0s)

arithmetic demotion

narrowing conversion;
e.g. int x = (int)3.14;

overflow condition

occurs when a calculation whose exact result lies outside of the Java integer range

underflow condition

occurs when a calculation whose exact result is a number of smaller absolute value than is acceptable

arithmetic/assignment operators

shorthand operators that perform an operation on a previous value assigned to a variable and assign the new value to the variable

increment operator

instructs Java to add one to a variable's current value and reassign the result to the variable; ++

decrement operator

instructs Java to subtract one from a variable's current value and reassign the result to the variable; --

pseudocode

a pre-programming technique for representing an algorithm in English-like statements

character literals

represented by a single keyboard character and are enclosed in single quotes

ASCII

the American Standard Code for Information Interchange which defines values for letters, numbers, punctuation marks, and some non-printable functions

object-oriented progamming

a program design technique based on modeling the interaction between classes of objects

index

indicates the position of a character in a string, i.e. in the string abcde, a has an index of 0 and b of 1

length

the total number of characters in a string

escape sequence

a pair of symbols beginning with a backslash that has a special meaning within a print statement

Java API

documentation for all of Java's classes (API = Application Programming Interface)

package

group of related classes

fields

an instance variable, but may also refer to a pre-defined class constant

methods

a segment of code that performs a specific task when invoked by a message statement

constructors

a statement that instantiates an object and initializes the object's private instance variables

bits

a binary digit (0 or 1)

conditional

a statement involving a binary decision

relational operators

an operator used to compare two values, variables, or expressions

flow of control

the order in which statements are executed (sequential, looping, branching, etc.)

identity operator

0

block of code

segment of code between a pair of opening and closing curly braces ({ and })

identity equality

refers to whether two objects are actually the same object

content equality

indicates whether two objects contain equal values

logical operators

an operator that can be applied to boolean values or expressions

sequential structures

execute in order from start to finish

conditional structures

alter the flow of control based on a boolean expression

iterative structures

alter the flow of control by repeating statements

loops

program statements that cause a segment of code to be repeated until a terminating condition is met

negation

the use of the logical operator ! (not) to reverse the evaluation of a Boolean expression from true to false or from false to true

nested loop

a loop which appears within the body of another loop

random access file

a file structure that allows access to information regardless of its position in the file

sequential file

a file structure that allows access to information based on its position in the file

open source

software that is released to the public domain for programmers to modify and improve as they see fit

data structure

a collection of data that is referred to by one name such as arrays and array lists

array

a data structure containing a single type of data (e.g. ints, Strings, etc.) which is accessed by index positions

linked list

a data structure that can hold an arbitrary number of objects in which each object points to the next link

tree

a data structure hierarchy that grows from a single root node

array lists

a data structure which stores objects and provides methods to add, delete, and retrieve indexed items

static methods

methods that reference no object at all

class

a data-type in object-oriented programming that consists of a group of objects with the same properties and behaviors and that is arranged in a hierarchy with other such data types

object

a data structure in object-oriented programming that can contain functions as well as data, variables, and other data structures

function

a computer subroutine; specifically, one that performs a calculation with variables provided by a program and supplies the program with a single result

method

a method is a collection of statements that are grouped together to perform an operation and can be invoked at any point in the program by utilizing its name

Unified Modeling Language (UML)

a standard for visually representing the design and documentation of a computer program

class diagram

a diagram that depicts use and inheritance relationships between classes

instance variable

a variable that is referenced by a specific object

overloading

the process that allows multiple methods to share the same name as long as their parameter lists differ

accessors

methods that access private instance variables but do not change them

mutators

methods that change the values of private instance variables

getters

methods that return a value to an invoking statement

setters

methods that only assign values to variables or objects

javadoc

a software tool that creates documentation in an HTML format

HTML

hyper text markup language, the code used to create web pages

class hierarchy

a class hierarchy displays classes in a hierarchy; the hierarchy is a specialized form of the class above it

inheritance

the process by which a class automatically contains the variables and methods defined in its superclass

polymorphism

the ability of being able to assign a different usage to a method

extend

when a class is extended, a subclass is created which may add more variables, methods, etc. than the original class had

public

when a variable, method, or class is public, it can be seen and used by any other class

superclass

the parent class of a subclass; the subclass is created by extending the superclass; there may be one or more classes in between the superclass and subclass

subclass

derived from a superclass; there may be one or more classes in between the subclass and superclass

direct subclass

a direct subclass is a subclass that has no classes in between itself and its superclass

aliasing

occurs when two or more different variables store one and the same object

abstract class

a type of class that is not meant to be instantiated and cannot be instantiated

interface

a Java keyword that defines a set of abstract methods to be implemented by a specific class

Comparable<T> interface

a built-in Java interface that allows objects to be compared

traversal

iteration through an array or ArrayList

bubble sort

works by repeatedly stepping through the array, comparing two array elements at a time. If the elements are out of order, then they are swapped; this process is repeated until going through the array results in no swaps

insertion sort

works by creating an empty array and then taking out 1 element at a time from the original array and placing it into the new array

selection sort

works by repeatedly going through the array and finding the largest element which is then swapped with the last position in the search area; each iteration, the search area is reduced by 1 in length. When the search area finally becomes the size of 2, you

merge sort

works by using a divide and conquer method to split the array apart until there are 1 element sets; these sets are then merged back together in sorted order; after all the merges are complete, the array is sorted