Java Data Types Flashcards
What is a variable?
A storage location in RAM
What 2 things must a variable have?
A name and a data type
What are 3 other words for variable “name”?
1) Identifier
2) Reference
3) Handle
What are we doing when we declare a variable?
Binding the name to a specific memory address
What can you NOT start a variable name with?
Number
What three things can you start a variable name with?
1) Letter
2) Underscore
3) $
What words can you not use for naming variables?
Java Reserved Words
What kind of notation is used for naming variables?
camelBack
What notation is used for naming classes?
TitleCase
Why do we specify data type when declaring variables?
Tells OS how many bytes of memory to allocate and helps interpret data.
How many characters are shared between ASCII and Unicode?
256
Primitive data types are the only things in Java that are not _______. Why?
Objects, because they have no methods.
How many primitive data types are there?
8
How many numeric primitive data types are there?
6
How many bits in a byte data type?
8 (1 byte)
How many bits in a short?
16 (2 bytes)
How many bits in an int?
32 (4 bytes)
How many bits in a long?
64 (8 bytes)
How many floating primitive types are there?
Two, float and double.
How many bits in a float?
32 (4 bytes)
How many bits in a double?
64 (8 bytes)
What are the two non-numeric data types?
char and boolean
How many bits in the char data type?
16 (2 bytes)
What are the two default numeric primitive data types?
int and double