Java Chapter 2 Terms
boolean variable
A _____ can hold only one of two values, true or false.
Data type
A _____ describes the type of data that can be stored there, how much memory the item occupies, and what types of operations can be performed on the data.
String
A _____ is a built-in class that provides you with the means for storing and manipulating character strings.
Numeric Constant
A _____ is a constant that is a number.
Unnamed Constant
A _____ is a constant with no identifier associated with it.
Strongly typed langauge
A _____ is a language in which all variables must be declared before they can be used.
Named constant
A _____ is a memory location whose value cannot change during program execution. Can be assigned a value only once. Usually, they are in all caps.
prompt
A _____ is a message displayed for the user that requests and describes input.
Variable
A _____ is a named memory location that you can use to store a value. It can only hold one value at a time, but the values it holds can change.
Primitive type
A _____ is a simple data type. There are eight of these types in Java; byte, short, int, long, float, double, char, boolean. They serve as the bulding blocks for more complex data types, known as reference types.
Variable declaration
A _____ is a statement that reserves a named memory location and includes the following: A data type that identifies the type of data that the variable will store, An identifier that is the variable's name, An optional assignment operator and assigned value if a varible is to contain an initial value, and an ending semicolon.
Garbage Value
A _____ is an unknown value.
floating-point
A _____ number contains decimal positions. Java supports two of these data types, float and double.
Literal Constant
A _____'s value is taken literally at each use.
Confirm dialog box
A ______ displays the options Yes, No, and Cancel; you can create one using the showConfirmDialog() method in the JOptionPane class.
Operand
A ______ is a value used on either side of an operator.
Constant
A data item is _____ when it svalue cannot be changed while a program is running; a data item is a variable when its value might change.
Floating point constant
A floating-point constant by default is a double, such as 18.23, but you can specify it as a float by using a declaration like this: float pocketChange = 4.87F;
Value stored in double or float
A value stored in a double is a double-precision floating point number, a value in a float is a single precision floating-point number.
Escape sequence
An _____ always begins with a backslash followed by a character - the pair represents a single character.
Input Dialog box
An _____ asks a question and provides a text field in which the user can enter a response.
Implicit conversion
An _____ is a conversion that automatically converts nonconforming operands to the unifying type. They are also called promotions.
Assignment operator
An _____ is the equal sign =; any value to the right of the equal sign is assigned to the variable on the left of the equal sign.
Initialization
An assignment made when you declare a variable is an _____.
Floats and Doubles
Floats use less memory than doubles do, but if a programmer is making graphic intensive software, they might opt to use a double for higher accuracy over memory conservation.
final
In its declaration statement, the data type of a named constant is preceded by the keyword _____.
Char
The _____ data type can be used to hold any single character.
int
The _____ data type is the most commonly used integer data type. Can hold from -2.4 billion to +2.4 billion. No commas or periods for int data types.
Keyboard buffer
The _____ is a location in memory where items are stored temporarily. It is sometimes called the type-ahead buffer.
Unifying type
The _____ is the type to which all operands in an expression are converted so that they are compatible with each other.
Binary operators
The arithmetic operators are examples of _____, so named because they require two operands.
Standard Input Device
The keyboard.
Remainder operator
The percent sign is the _____. It is most often used with two integers, and the result is an integer with the value of the remainder after division takes place.
Consumed
When you accept an entry and discard it without using it, programmers say that the entry is _____.
showInputDialog() method
You can create an input dialog box using the _____.
Type-wrapper classes
_____ (e.g., Integer, Double, Boolean) enable programmers to manipulate primitive-type values as objects. Objects of these classes can be used in collections and data structures that can store only references to objects—not primitive-type values.
Reference types
_____ are complex data types that are constructed from primative types.
Arithmetic operators
_____ are used to perform calculations with values in programs.
Relational Operators
_____ compare two items; they are sometimes called comparison operators. Java supports 6 of them; < operator meaning less than, > operator meaning greater than, == operator meaning equal to, <= less than or equal to, >= greater than or equal to, and != not equal to.
Type casting
_____ forces a value of one data type to be used as a value of another type. To perform this, you use a cast operator, which is created by placing the desired result type in parentheses. Using a cast operator is an explicit conversion.
Blank final
_____ happens if you do not initialize the constant at declaration.
Byte
_____ is a variation of the integer data type. It can hold -128 to +127 and is 1 byte in size.
Short
_____ is a variation of the integer data type. It can hold -32,768 to +32,767 and is 2 bytes in size.
long
_____ is a variation of the integer data type. It can hold −9,223,372,036,854,775,808 to +9,223,372,036,854,775,807 and is 8 bytes in size.
Scope
_____ is the area in which a data item is visible to a program where you can refer to it using its simple identifier.
Integer Division
_____ occurs when both of the operands are integers. The result is an integer and any fractional part of the result is lost.
Floating-point division
_____ occurs when either or both of the operands are floating-point values.
Significant Digits
_____ refers to the mathematical accuracy of a value. Floats, for example, have 14 or 15 significant digits of accuracy.
Associativity
_____ refers to the order in which values are used with operators. Left to right or right to left.
If an application uses a literal constant integer...
the number is an int by default. If you need to use a constant higher than 2,147,483,647, you must follow the number with the letter L to indicate long. For example, the following statement stores a number that is greater than the maximum limit for the int type. long mosquitosInTheNorthWoods = 2444555888L;
tokens
the scanner object breaks its input into units called _____, separating them when it encounters whitespace.