Chapter 2 Flashcards
What is a constant?
Data item whose value cannot be changed while a program is running
What is a variable?
- Named memory location used to store a value
- Can hold only one value at a time
- Its value can change
What does the data type describe?
- How much data that can be stored
- How much memory an item occupies
What are reference types?
- Complex data types
- Hold memory adresses
What is an uninitialized variable?
- Declared within a method, but no value assigned
- Garbage value
What is a named constant?
- Named memory location for which values should not change
- decloration statement is preceded by keyword final
What is a scope?
Area in which a data item is visible to a program
When is a variable or constant in scope?
From the point it is declared up until the end end the bllock where the decloration lied
What are the integer types?
int, byte, short, and long
What must you do when you use long integer types?
use “L”
i.,e, long test = 200000000000L
What must you do when you use float data types?
Type the letter “f”
i.e., float test = 2000000000F
What is an escape sequence?
- Allows you to store nonprinting character such as a backspace or a tab in a char variable
- Begins with a backword slash followed by a character
What is a string?
- Built-in class
- Stores and manipulates character strings
- String constants are written between double quotation marks
What are text blocks?
- Multiline lateral string
- Start and end with three double characters
What does system.out refer to?
Standard output device, usually the monitor