FINAL EXAM Flashcards
(33 cards)
The Java programming language supports various arithmetic operators for all floating-point and integer numbers.
Arithmetic Operators
Are used to increase or decreasing the value of an operand. Increment operator adds 1 to the value of a variable, whereas the decrement operator decreases a value.
Unary Operators
==
Equal to
!=
Not equal to
>
Greater than
> =
Greater than or equal to
<
Less than
<=
Less than or equal to
&&
Conditional - AND
l l
Conditional - OR
Can compare numbers or strings and perform evaluations. (instanceof)
Comparison Operator
~
Unary Bitewise Complement
«
Signed Left Shift
> >
Signed Right Shift
> > >
Unsigned Right Shift
&
Bitwise AND
( ^ )
Bitwise Exclusive OR
l
Bitwise inclusive OR
Change values of variables, call methods and create objects
Expression Statement
Declare variables
Declaration Variables
Determine the order that statements are executed
Typically, Java statements parse from the top to the bottom of the program
Control-Flow Statement
Sequence of zero or more statement enclosed in braces { }
Generally used to group together several statements, so they can be used in a situation that requires you to use a single statement
Block Statement
Use if to specify a block of code to be executed, if a specified condition is
true
Use else to specify a block of code to be executed, if the same condition is
false
Use else if to specify a new condition to test, if the first condition is false
Use switch to specify many alternative blocks of code to be executed
Conditional Statement
Use the if statement to specify a block of Java code to be executed if a condition is true.
If Statement