AP Computer Science

double

A Java reserved word that represents a primitive floating point numeric type, stored using 64 bits in IEEE 754 format. Ex. 4.23

int

A java reserved word for a primitive dat type, stored using 32 bits in two's complement format. Ex. 5

boolean

A Java reserved word for a logical primitive data type that can only take the values "True" or "False".

string literal

A primitive value used in a program.
Ex. ("Hello")

casting

Most general form of converting in Java
Ex. dollars = (int) money

narrowing conversion

A conversion from one data type into another in which information could be lost. Converting from "double" to an "int" is a narrowing conversion

strongly typed

Assigned values must correspond to the declared type.

//

Comments a line of code in Java that will not be run with the program. More of a side note.
//Hello

%

Remainder operator.

Operator Precedence Hierarchy

The order in which operators are evaluated in an expression.

primitive data

Characters with letters, or numbers: int, double, booleans

constant

A value that cannot be changed. Used to make more code more readable and to make changes easier. Defined in Java using the "final" modifier.

final

A Java reserved word that is a modifier for classes, methods, and variables. A "final" variable is a constant

void

A Java reserved word that indicates that no value is returned.

main

Method that appears within a class, it invokes other methods.

System.out.println()

Displays text for the user:
Ex.
System.out.println("Hello")
Hello

public

A Java reserved word for a visibility modifier. A public class or interface can be used anywhere. A public method or variable is inherited by all subclasses and is accessible anywhere.

private

A Java reserved word for a visibility modifier. Private methods and variables are NOT inherited by subclasses and can only be accessed in the class in which they have been declared.

static

A Java reserved word that describes methods and variables. A static method is also called a class method and can be referred without an instance of the class. A static variable is also called a class variable and is common to all instances of a class; Dat

Assignment Statement

Uses the equal sign to give the object property on the left of the equal sign the value on the right of the equal sign.

Variable

An identifier in a program that represents a memory location in which a data value is stored.

Escape Sequence

In Java characters beginning with the backslash character (\), used to indicate a special situation when printing values. For example, the escape sequence \t means that a horizontal tab should be printed; Special way to represent characters in a String.

class

1) A Java reserver word used to define a class
2) The blueprint of an object - the model that defines the variables and methods an object will contain when instantiated.

object

1) The basic software part in an Object-Oriented program.
2) An encapsulated collection of data variables and methods.
3) An instance of class.
Has state and behavior.

Method

A named group of declarations and programming statements that can be invoked (executed) when needed. A Method is part of a class. Alters an objects State.

Object Reference Variable

A variable that holds a reference to an object, but not the object itself. Stores the address where the object is stored i memory. Variable name for the Object.

Abstraction

The idea of hiding details. If the right details are hidden at the right times, abstraction can make programming simpler and better focused.

Object-Oriented Programming

An approach to software design and implementation that is centered around Objects and Classes.

Concatenation

Puts together two or more Character strings.
To link together in a series.
Ex. ("Hello " + Name )

Encapsulation

The characteristic of an object that limits access to its variables and methods. All interaction with the object occurs through an interface. Each object protects and manages its own information.

Inheritance

The ability to create a new class from an existing one. Inherited variables and methods of the original (parent) class are available in the new (child) class as if they were declared locally.

Polymorphism

A technique for involving different methods at different times. all Java method invocations can be polymathic because the invoke the method of an object type, not the reference type. (Multiple children of the same parents)

Attribute

A Characteristic. Properties of an object.

State

The state of being an object, defined by the values of its dat. Fields

Behavior

What an object does, defined by its methods. Methods or Functions

Constructor

A method that is run when an object is instantiated, usually to initialize that object's instance variables.

instantiate

The process of creating a new object and assigning it a value.

members

Properties and methods of a class.

invoke

evoke or call forth, with or as if by magic

Parameter

A value passed through a method when invoke.