1: Chapter 1 & 2 Flashcards
Algorithm
A step-by-step description of how to accomplish a task.
Program
A list of instructions to be carried out by a computer.
Binary number
A number composed of just 0s and 1s, also known as a base-2 number.
Digital
Based on numbers that increase in discrete increments, such as the integers 0, 1, 2, 3, etc.
Program execution
The act of carrying out the instructions contained in a program.
Compiler
A program that translates a computer program written in one language into an equivalent program in another language (often, but not always, translating from a high-level language into machine language).
Java Virtual Machine
A theoretical computer whose machine language is the set of Java bytecodes.
Java Runtime
A program that executes compiled Java bytecodes.
Java Class Libraries
The collection of preexisting Java code that provides solutions to common programming problems.
Console window
A special text-only window in which Java programs interact with the user.
Class
A unit of code that is the basic building block of Java programs.
Method
A program unit that represents a particular action or computation.
Statement
An executable snippet of code that represents a complete command.
Identifier
A name given to an entity in a program, such as a class or method.
Comment
Text that programmers include in a program to explain their code. The compiler ignores comments.
Decomposition
A separation into discernible parts, each of which is simpler than the whole.
Iterative enhancement
The process of producing a program in stages, adding new functionality at each stage. A key feature of each iterative step is that you can test it to make sure that piece works before moving on.
Static method
A block of Java statements that is given a name.
Method call
A command to execute another method, which causes all of the statements inside that method to be executed.
Flow of control
The order in which the statements of a Java program are executed.
Data type
A name for a category of data values that are all related, as in type int in Java, which is used to represent integer values.
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 (like + or *) that is used to indicate an operation to be performed on one or more values.
Precedence
The binding power of an operator, which determines how to group parts of an expression.
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.
String concatenation
Combining several strings into a single string, or combining a string with other data into a new, longer string.
Control structure
A syntactic structure that controls other statements.
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.
Localizing variables
Declaring variables in the innermost (most local) scope possible.
Infinite loop
A loop that never terminates.
Pseudocode
English-like descriptions of algorithms. Programming with pseudocode involves successively refining an informal description until it is easily translated into Java.
Class constant
A named value that cannot be changed. A class constant can be accessed anywhere in the class (i.e. its scope is the entire class).
Widening
The process of changing a value’s data type from a narrower one to a wider one. Widening is a “safe” conversion because there is no potential loss of information.
Narrowing
A programmer may force narrowing to occur by using an explicit type cast in an expression. Type casts have higher precedence than all arithmetic operations.
Overloaded operator
The plus sign (+) is said to be an overloaded operator because it performs different operations on different types of data (concatenation if operands are of type string and addition if operands are numeric types). The division operator is also overloaded (ints vs. doubles).
Describe the flow of the Java Virtual Machine.
Your source code (.java file) is compiled by the Java compiler into Java bytecodes (.class file), which is then interpreted by the Java Virtual Machine so that it can run on Mac, Windows, Unix, etc.
Source code (.java file) –> compiled by Java compiler –> Java bytecodes (.class file) –> JVM (interpreter) –> Mac, Windows, Linux