Java Methods Part 2 Flashcards
(60 cards)
_____ are used to carry out specific actions
and are sometimes called functions.
Methods
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 _______ is the starting point of a Java
program, and it is the first method executed by
the JVM (Java Virtual Machine).
main() method
The main() method is the starting point of a Java
program, and it is the first method executed by
the _______________.
JVM (Java Virtual Machine)
Methods in Java are ________________ designed to perform specific tasks.
reusable blocks of
code
They help break 1.____, 2._________ into 3._________, easier-to-handle parts
1.large
2.complex programs
3. smaller
_________ are used to compare two values
or variables.
Relational operators
Relational operators are used to compare 1.________
or 2.________.
- two values
- variables
They return a _______ result: true or false.
Boolean
They return a Boolean result: _________.
true or false
These operators are commonly used in________________ like if, while, and for.
decision-making statements
These operators are commonly used in decision-making statements like ___________.
if, while, and for
______ can be of any numeric type (int, double, etc.) or even Strings/Text (for == and !=).
Operands
__________ are binary operators (they work
with two operands).
Relational operators
Relational operators are __________ (they work
with two operands).
binary operators
_________________ are used to combine multiple
conditions or expressions.
Logical operators
Logical operators are used to combine 1.___________ or 2._________.
1.multiple conditions
2.expressions
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.
! (Logical NOT)
For 1.__, if the first condition is 2.__-e, the second condition is not evaluated.
1.&&
2.fals
For 1.___, if the first condition is true, the second condition is not evaluated.___
- ||
2.true
____________ are used to make decisions in a program based on certain conditions.
Selection statements