Java question:
1)for every 'if ' there should be an 'else '
2)for evey ' else ' there should be an 'if '
3)'if ' block can exist without an 'else '
4)'if ' condition can be used inside another 'if ' condition
Choose the correct option:
•Only 2,3,4 are correct.
•All statements are true.
•Only 2 and 3 are true.
•Only 3 is true.
Answers
Answered by
3
Answer:
•Only 3 is true.
I hope I will help you
Answered by
1
Option Only 3 is true
Explanation:
- The Java if statement is the simplest decision-making statement. It is used to decide whether a certain statement or block of statements will be executed or not.
- The if statement consists of a Boolean expression followed by one or more statements.
- If the expression evaluates to true, then the statement block will be performed. If this is not the case, the first set after the if statement (after the closing curly brace) will be performed.
Similar questions