Select the best answer about the following code fragments (a) and (b): (a) if (age System.out.println ("no beer for you"); if (age >= System.out.println ("BEER!"); 21) 21) (b) 21) if (age...


Select the best answer about the following code fragments (a) and (b):<br>(a)<br>if (age<br>System.out.println<br>(= System.out.println ("BEER!"); 21) 21) (b) 21) if (age System.out.println ("no beer for you"); else System.out.println ("BEER"); O (a) is correct, (b) is incorrect because it is missing (age >= 21) after else (a) is incorrect, (b) is correct O both (a) and (b) are correct, but (b) is better both (a) and (b) are correct, but (a) is better. "/>
Extracted text: Select the best answer about the following code fragments (a) and (b): (a) if (age System.out.println ("no beer for you"); if (age >= System.out.println ("BEER!"); 21) 21) (b) 21) if (age System.out.println ("no beer for you"); else System.out.println ("BEER"); O (a) is correct, (b) is incorrect because it is missing (age >= 21) after else (a) is incorrect, (b) is correct O both (a) and (b) are correct, but (b) is better both (a) and (b) are correct, but (a) is better.

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here