Unit 1: CS21 Review Flashcards
what are string literals
a sequence of characters enclosed in double quotes which is assigned to a variable
data type
Determines what kind of data a variable can hold
examples of primitive data types
int, double, boolean, and *char
*not mentioned on the AP test
double is more bits than int
true
athematic expressions
expressions with int or double formed by +,-,*,/, and %
int + int
int
int + double
double
when doing mod does the big or small number go first?
big
compound expressions
expressions with multiple arithmetic operators
what is order precedence
PEMDAS
what is the assignment operator
=
what are the increment operators?
++,—
what happens when a variable is declared as final?
the value can’t be changed once it’s initialized, any attempt results in an compilation error
compound assignment operators
+=,-=,*=,=, %=
casting
process of converting a variable from one data type to another