https://courses.cs.washington.edu/courses/cse121/.
Sequence | Description |
---|---|
\t | tab |
\n | new line |
\" | quotation mark |
\\ | backslash |
Type | Description | Examples |
---|---|---|
int | integers, numbers without fractional components | 42 , -3 , 92851 |
double | decimal numbers | 3.14 , 2.0 |
String | text | "Hello" , "CSE 121" |
boolean | logical values | true , false |
()
before *
/
%
before +
-
int
, /
is integer division and %
is integer remainder(Compute a value using arithmetic operations)
Operator | Meaning |
---|---|
+ | addition |
- | subtraction, negation |
* | multiplication |
/ | division |
% | remainder (“modulus”) |
Operator | Description |
---|---|
< | less than |
<= | less than or equal |
> | greater than |
>= | greater than or equal |
== | equal |
!= | not equal |
(Evaluate expressions as true or false)
Operator | Description |
---|---|
&& | and |
|| | or |
! | not |
&&
¶Expression | Result |
---|---|
true && true | true |
true && false | false |
false && true | false |
false && false | false |
||
¶Expression | Result |
---|---|
true || true | true |
true || false | true |
false || true | true |
false || false | false |