expressions Flashcards
expression
is combination of one or more operators and operands that usually performs calculation
20/5
20.0/5
20/5.0
20.0/5.0
4
- 0
- 0
- 0
-/+
uniry or binary
true or false
the assignment operator (=)has lower prcedence than any of arthmitic operators
true
the evoluation of particular expression can be shown using an ……………….
expresion tree
precdence page 106
((19+8)%3)-4) ;
(19(+8%)3-4);
not valid
not valid
how the compiler calculate this
count = count +1;
calculate this count +1
and then overwrite the old value
increement(++) decrement–
without white space if there is white space then it is called string concatenation
postfix and prefix
count ++.++count
in the first increase first
in the second increase after
total+=5
mean
total=total +5;
assignment conversion
when a value of one type is assigned to anthor variable during the value is converted to the new type
casting is the most general form of conversion in java
dollars =(int )money ;
the cast operator has a higher precedence than the division operator
result =(float) total /count ;
the cast operators on the value of total not in the result of the division