Chapter 2 Flashcards
in a program are used to store data such as numbers and letters. They can be thought of as containers of a sort. The number, letter, or other data
Variabels
To know the name of the variable, how much computer memory to reserve for the variable, and how the data item in the variable is to be coded as strings of 0s and 1s. You give this information in
variable declaration
The variable can hold whole numbers, such as 42, −99, 0, and 2001. A whole number is called
Integer
What is a data type for objects of a class called?
class type
How many primitive type do we have ?
8
Which Primitive Type has the range of -128 to 127
byte
Which Primitive Type has the range of -32,768 to 32,767 ?
short
Which Primitive Type has the range of -2,147,483,648 to 2,147,483,647
int
Which Primitive Type has the range of -9,223,372,036,8547,75,808 to 9,223,372,036,854,775,807
Long
What kind of value is char?
Single character (Unicode)
What kind of value is float?
floating-point
How much memory does boolean use?
1 bit
Which Primitive Type has the range of ±3.40282347 × 10 +38 to ±1.40239846 × 10 −45
Float
Which Primitive Type has the range of ±1.79769313486231570 × 10 +308 to ±4.94065645841246544 × 10 −324
double
Which Primitive Type has the range of 0 to 65,535
char
How many floating point do we have?
2
A number having a fractional part—such as the numbers 9.99, 3.14159, −5.63, and 5.0—is called
floating-point number
As with integer types, the differences between float and double involve the range of their values and their storage requirements. If you cannot decide between the types float and double, use
double
Are these legal identifier? inputStream, YourClass, CarWash, hotCar, theTimeOfDay
yes
We will always follow the convention that the names of classes start with
Upper case letter