Primitive Data Types Flashcards
Double
8 bytes, 10^308 range
Float
4 bytes, 10^38 range
Long
8 bytes, 10^18 range
Short
2 bytes, 10^4 range
Char
2 bytes
Automatic conversion
automatic: small -> big
Type Cast
big range -> small range
Variables
location in memory that stores data
Condition
A question with 2 answers: true or false
Break
When executed, inner most loop that contains the break statement will be exited immediately
Continue
When executed, remainder of current iteration will be skipped
String
a data type that stores a sequence if characters. OBJECT type NOT data
StringBuilder
Another type to represent String info but is mutable (can be changed)
Pre-Increment/Decrement
++var (increments, then returns var)
Post-Decrement/Increment
var++ (returns var, increments)
Stack
Variables that are created in the main or other methods. References are on the stack
Heap
New objects
Parameters
Variables that are part of the function being called
Arguments
Values that are passed in when a function call happens
Stack Frames
- Created with each method call
- local variables and formal parameters are stored
- then destroyed after return
Overloading
If two methods have the same name, but different signatures. Compiler selects proper method when calling overloaded method.