Computer Science 1101 Final

Algorithm

A step by step description of how to accomplish a task

Program

A list of instructions to be carried out by a computer

Hardware

The physical components that make up a computer

Software

Computer programs

Operating System

The primary piece of software running on a computer; provides an environment in which many programs may be run at the same time

Binary numbers

Computers store integers as binary numbers (numbers composed of just 0s and 1s)

Execution

Carrying out the instructions contained in a program

Compiler

A program that translates a computer program written in a high-level language into machine language

Java Virtual Machine (JVM)

Compiles Java programs into Java byetcode

Integrated Development Environments (IDEs)

Provide an all-in-one environment for creating, editing, compiling, and executing programs

Console window

A special, text-only window where Java programs interact with the user

Class

A unit code thetis the basic building block of a Java program

Java Class Libraries

The collection of preexisting Java code that provides solutions to common programming problems

Method

A program unit that represents a particular action of computation

Statement

An executable snippet of code that represents a complete command

Escape Sequences

Two-character sequences that are used to represent special characters

Identifier

A name given to an entity in a program, such as a class or method

Comment

Text that programmer include in a program to explain their code that are not displayed as output

Syntax Errors

Error that occur when you misuse java language; are caught by the compiler and prevent a program from executing

Logic Errors

Occur when you write code that doesn't perform the task its intended to; cause the program to produce the wrong output

Runtime Errors

Logic errors that are so severe they stop the program from running

Procedural Decompositions

Dividing up the overall action of the program into a series of smaller actions

Method Call

A command to execute another static method, which causes all of the statement inside the static method to be executed

Flow of control

The order in which the statements of a program are executed

Type-safe language

Java is a type-safe language, meaning that it requires you to be explicit about what kind of information you intend to manipulate

Expression

A simple value or a set of operations that produces a value

Evaluation

The process of obtaining the value of an expression

Operator

A special symbol that is used to indicate an operation to be performed

Precedence

The binding power of an operator, which determines how to group parts of an expression

Cast

A mechanism for requesting that a value be converted from one type to another

Variable

A memory location with a name and a type that stores a value

Declaration

A request to set aside a new variable with a given name and type

Initialization

Once a variable is declared, it must be initializes with a value

String Concatenation

Combining several strings into a single string, or combining a string with other data into a new, longer string

For loops

For loops help to avoid redundancy by repeatedly executing a sequencer of statements for a particular range of values

Controlled Structure

A structure that controls other statements and determines if they are executed

Nested loop

One for loop that can control another loop

Infinite loop

A loop that never terminates

Scope

The part of a program in which a particular declaration is valid

Local Variable

A variable declared inside a method that is accessible only in that method

Psuedocode

English-like descriptions of algorithms

Class constants

A named value that is accessible anywhere in a class whose value cannot be changed

Parameter

Any one characteristic that distinguished different members of a family of tasks

Formal parameter

A variable that appears inside parentheses in the header of a method that is used to generalize the method's behavior

Actual parameter

A specify value or expression that appears inside parentheses in a method call

Method Signature

The name of the method, along with its number and type of parameters

Overloading

The ability to define two or more methods with the same name but different method signatures

Method Return

To send a value out as the result of a method that can be used in an expression in your program

The Math Class

A predefined Java class that includes mathematic constants and functions

Object

A programming entity that contains state and behavior

Class

A category or type of object

Index

An integer used to specify a location in a sequence of values; Java generally uses zero-based indexing

Exception

A runtime error that prevents a program form continuing to execute

Interactive Programs

Pause and wait for users to type a response before executing the code

Token

A single element of input, separated by whitespace

If/else statements

Statements that allow you to execute code some of the time, but not all of the time; an example of a controlled structure

Cumulative algorithms

Operations where the overall value is computed incrementally

Roundoff Errors

Errors in rounding that occur because floating-point numbers are stored as approximations

Text processing

editing and formatting strings of text

Preconditions

The conditions that must be true before a method executes in order to guarantee that the method can perform its task

Postconditions

The conditions that the method guarantees will be true after it finishes executing, so long as the preconditions were met before the method was called

Indefinite loops

Loops that executes an unknown number of times

While loop

A loop that repeatedly tests and executes the controlled statements if the test evaluates to true

Pseudorandom numbers

Numbers that, although they are derived from predictable and well-defied algorithms, mimic the properties of numbers chosen randomly

Fencepost Problems

Problems that cannot be solved with regular for loops because they need to have "posts" planted on either end, since loops produce the same number of "posts" and "wires" in each iteration

Sentinel Loops

Loops that repeat until the sentinel (a special value signaling the end of input) is reach

Short-Circuited Evaluation

The property of the logical operators && and || that prevents the second operand from being evaluated if the overall result is obvious from the value of the first operand

Flags

Boolean variables used in loops to record error conditions or signal completion

Boolean Zen

Eliminates the need to use if/else statements in boolean method because a return statement will return true if the expression evaluates to true and false when it evaluates to false

Assertions

Declarative senses that are always true, sometimes true, or never true

Provable Assertions

Assertions that can be proven to be true at a particular point in a program's execution

Diles

Collections of information that are stored on a computer and accessible in a program

Throws Clauses

Declarations that a method will not attempt to handle a particular type of exception

File Path

A description of a file's location on a computer, starting with a drive and including the path from the root directory where the file is stored

Current directory

The directory that Java uses as the default when a program uses a simple file name

Token-Based Processing

Processing input one word at a time or one number at a time

Line-Based Processing

Processing input line by line

Array

An indexed structure that holds multiple values (elements) of the same type

Random Access

Manipulation of values in any order whatsoever; provided by arrays

Array Traversal Loop

Uses a variable of type int and a for loop to access the index of each element in an array

For-Each Loop

Used to access each value in an array

Command-Line Arguments

In the main method, String[] args creates an array of String objects, and Java itself initializes this array if the user provides command-line arguments when invoking Java

A special value meaning "no object

Value Semantics

A system in which values are stored directly and copying is achieved by creating independent copies of values; types using value semantics are called value types

Reference Semantics

A system in which values are stored directly and copying is achieved by creating independent copies of values; types using reference semantics are called reference types

Object-Oriented Programming (OOP)

Reasoning about a program as a set of objects rather than as a set of actions

Object

A programming entity that contains state and behavior

State

A set of values (internal data) stored in an object

Behavior

A set of actions an object can perform, like reporting modifying its internal state

Client code

Code that interacts with a class or objects of that class by sending messages them and asking them to perform behaviors

Classes

A program or a blueprint for a new type of object

Field

A variable inside an object (also known as an instance variable) that makes up part of its internal state

Static Method

A method that belongs to a class rather than an object of a class; can only access static variables

Instance Method

A method inside an object that operates on that object

Implicit Parameter

The object that is referenced during an instance method call

Mutator

An instance method that modifies an object's internal state

Accessor

An instance method that provides information about the state of an object without modifying it

Constructor

A piece of code that initializes the state of new objects as they are created

Shadowing

Shadowing occurs when a field is obscured by another variable with the same name

This

A reference to the implicit parameter (the object on which a method is called)

Encapsulation

Hiding the implementation details of an object from the clients of the object; a form of abstraction

Class Invariant

An assertion about an object's state that is true for the lifetime of that object

Code Reuse

The practice of writing program code once and using it in many contexts

Is-a Relationship

A hierarchical connection between two categories in which one is a specialized version of the other

Has-a Relationship

A connection between two objects where one has a field that refers to the other; one class cannot be substituted for the other class

Inheritance classes

A set of hierarchical relationships between classes of objects

Inheritance

A programming technique that allows a derived class to extend the functionality of a base class, inheriting all of its state and behavior

Subclass

The derived class

Superclass

The parent class

Overriding

Implementing a new version of a method that would otherwise have been inherited from a subclass

The object class

A class called Object that serves at the ultimate superclass for all other Java classes, even those that do not declare explicit superclasses in their headers

Polymorphism

The ability for the same code to be used with several different types of object and for the code to behave differently depending on the actual type of object use

Late Binding, Virtual Binding, or Dynamic Dispatch

When the program creates a particular call on an object's method, it examines the actual object to see which method to call

Substitutability

The ability of an object of a subclass to be used successfully anywhere an object of the superclass is expected

Interface

A common super type between several classes that do not share code

Abstract method

A method that is declared but not implemented; represents the behavior that a class promises to implement when it implements an interface