data types in java Flashcards
1
Q
int (whole numbers)
A
integer only holds values of neg + pos whole numbers
2
Q
double (real numbers 6.2)
A
decimals
pos + neg nums
can hold whole nums but main use fractional values
3
Q
boolean (true / false)
A
evaluate true false conditions
4
Q
flaost (real numbers)
A
similar to doubles
hold values of better precision
stores these differently.
5
Q
long (long ints)
A
big int values
6
Q
chars (characters - b)
A
hold single characters
7
Q
string (“hello world”)
A
non primitive
collection of characters
8
Q
variables
A
uses CamelCase (naming convention) does not need to be declared with a value) store + manipulate data (can be changed while program runs)
9
Q
constant
A
uses ALL_CAPITALS as a naming convention
uses final keyword in java
needs value (cannot be changed)
10
Q
both
A
identifier/name associated with a particular memory location cannot be called reserve words have spaces case sensitive
11
Q
procedure
A
- named identifier
- performs a task
- returns no value
12
Q
function
A
- named identifier
- performs a task
- returns a single value based on return type
13
Q
parameter
A
- named identifier
- allows data to be inputted into a procedure or function
- has a data type
- referenced in code and substituted with the value