CS160 Final Review Questions With
Correct Answers
literals - CORRECT ANSWER✔✔-values that are directly recognized by Java
| | | | | | | | |
types of literals - CORRECT ANSWER✔✔-numbers, characters, or strings
| | | | | | | |
identifier - CORRECT ANSWER✔✔-a name, such as the name of a variable
| | | | | | | | | | |
identifiers can contain... - CORRECT ANSWER✔✔-letters, digits, underscores, and
| | | | | | | | |
dollar sign characters
| |
the first character of an identifier has what constraint? - CORRECT ANSWER✔✔-
| | | | | | | | | | |
first character of an identifier cannot be a number
| | | | | | | |
in java, what are the two kinds of data types? - CORRECT ANSWER✔✔-primitive
| | | | | | | | | | | | |
data types and classes
| | |
examples of primitive data types - CORRECT ANSWER✔✔-int, char, double,
| | | | | | | | | |
boolean
characteristics of primitive data types - CORRECT ANSWER✔✔-hold a single,
| | | | | | | | | |
indivisible piece of data, predefined by the language
| | | | | | |
, examples of classes - CORRECT ANSWER✔✔-String, System
| | | | | |
characteristics of classes - CORRECT ANSWER✔✔-hold complex combinations of
| | | | | | | | |
data, programs may define new classes
| | | | |
primitive integer types - CORRECT ANSWER✔✔-byte, short, int, and long
| | | | | | | | |
most common integer type - CORRECT ANSWER✔✔-int
| | | | | |
primitive floating point types - CORRECT ANSWER✔✔-float and double
| | | | | | | |
most common floating point type - CORRECT ANSWER✔✔-double
| | | | | | |
primitive character type - CORRECT ANSWER✔✔-char
| | | | |
primitive boolean type - CORRECT ANSWER✔✔-boolean
| | | | |
primitive integer types, ordered from most to least memory used - CORRECT
| | | | | | | | | | | |
ANSWER✔✔-long (8 bytes), int (4 bytes), short (2 bytes), byte (1 byte)
| | | | | | | | | | |
memory used for a float type - CORRECT ANSWER✔✔-4 bytes
| | | | | | | | |
memory used for a double type - CORRECT ANSWER✔✔-8 bytes
| | | | | | | | |
Correct Answers
literals - CORRECT ANSWER✔✔-values that are directly recognized by Java
| | | | | | | | |
types of literals - CORRECT ANSWER✔✔-numbers, characters, or strings
| | | | | | | |
identifier - CORRECT ANSWER✔✔-a name, such as the name of a variable
| | | | | | | | | | |
identifiers can contain... - CORRECT ANSWER✔✔-letters, digits, underscores, and
| | | | | | | | |
dollar sign characters
| |
the first character of an identifier has what constraint? - CORRECT ANSWER✔✔-
| | | | | | | | | | |
first character of an identifier cannot be a number
| | | | | | | |
in java, what are the two kinds of data types? - CORRECT ANSWER✔✔-primitive
| | | | | | | | | | | | |
data types and classes
| | |
examples of primitive data types - CORRECT ANSWER✔✔-int, char, double,
| | | | | | | | | |
boolean
characteristics of primitive data types - CORRECT ANSWER✔✔-hold a single,
| | | | | | | | | |
indivisible piece of data, predefined by the language
| | | | | | |
, examples of classes - CORRECT ANSWER✔✔-String, System
| | | | | |
characteristics of classes - CORRECT ANSWER✔✔-hold complex combinations of
| | | | | | | | |
data, programs may define new classes
| | | | |
primitive integer types - CORRECT ANSWER✔✔-byte, short, int, and long
| | | | | | | | |
most common integer type - CORRECT ANSWER✔✔-int
| | | | | |
primitive floating point types - CORRECT ANSWER✔✔-float and double
| | | | | | | |
most common floating point type - CORRECT ANSWER✔✔-double
| | | | | | |
primitive character type - CORRECT ANSWER✔✔-char
| | | | |
primitive boolean type - CORRECT ANSWER✔✔-boolean
| | | | |
primitive integer types, ordered from most to least memory used - CORRECT
| | | | | | | | | | | |
ANSWER✔✔-long (8 bytes), int (4 bytes), short (2 bytes), byte (1 byte)
| | | | | | | | | | |
memory used for a float type - CORRECT ANSWER✔✔-4 bytes
| | | | | | | | |
memory used for a double type - CORRECT ANSWER✔✔-8 bytes
| | | | | | | | |