What’s the Output?
Consider the following two unformatted code segments where variables a and b have been declared as boolean:
(i) if (a)
if (b) System.out.println("Hello"); else System.out.println("Goodbye")
(ii) if (a)
{if (b) System.out.println("Hello");} else System.out.println("Goodbye");
Determine the output of each segment, (i) and (ii), assuming:
a. a = true, b = true
b. a = true, b = false
c. a = false, b = true
d. a = false, b = false
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.