Pertanyaan

13. In Java, an if statement can be nested-inside another if statement. True or False? True False 14. In a boolean expression which uses the & operator, what would make this expression evaluate to true? boolean x= (firstCondition &secondCondition); If the first condition is true, but the second condition is false If both the first condition and second condition are true If both the first condition and second condition are false If the first condition is false,but the second condition is true

Solusi

Terverifikasi Ahli
4.5 (125 Suara)
Raghav master ยท Tutor selama 5 tahun

Jawaban

**13. In Java, an if statement can be nested-inside another if statement. True or False?****True**In Java, it is perfectly legal to nest if statements. This means you can have one if statement inside another if statement to create a layered condition check.**14. In a boolean expression which uses the & operator, what would make this expression evaluate to true?****boolean (firstCondition & secondCondition);*** **If both the first condition and second condition are true**The `&` operator in a boolean context evaluates to true only if both operands (conditions) are true. If either of the conditions is false, the result will be false.