JAVA METHOD PART 2 Flashcards
________ in Java are like the basic units or building
blocks of a Java program.
Methods
A method is a group of code that performs a
specific _____ or __________.
task or operation
Methods are used to carry out specific actions
and are sometimes called _________.
functions
In Java, a method runs only when it is called from
another _______.
method
The main() method is the starting point of a Java
program, and it is the first method executed by
the __________________.
Java Virtual Machine
Checks if two values are equal
== (Equal To)
Checks if two values are not equal.
!= (Not Equal To)
Checks if the left operand is greater than the right operand
> (Greater Than)
Checks if the left operand is less than the right operand.
< (Less Than)
Checks if the left operand is greater than or equal to the right operand.
> = (Greater Than or Equal To)
Checks if the left operand is less than or equal to the right
operand.
<= (Less Than or Equal To)
_________ can be of any numeric type (int, double, etc.) or
even Strings/Text (for == and !=).
Operands
____________ operators are _______ operators (they work
with two operands).
RELATIONAL operators are BINARY operators (they work
with two operands)
____________ are used to combine multiple conditions or expressions.
Logical operators
Returns true only if both conditions are true
&& (Logical AND)
Returns true if at least one condition is true
|| (Logical OR)
Reverses the result of a condition.
Returns true if the condition is false, and vice versa.
! (Logical NOT)
For &&, if the first condition is _____, the second condition is
not evaluated
false
For ||, if the first condition is _____, the second condition is not evaluated.
true
Logical operators can combine multiple ________ or________
expressions.
relational or Boolean
Selection statements are used to make ________ in a program based on certain conditions.
decisions
Selection statements are essential for controlling the ____ of a program.
flow
_______________ are used to make decisions in a program based on certain conditions.
Selection statements
Executes a block of code if a specified condition is true.
if Statement