Question: Question 5 Consider the following code fragment: boolean passed = false; someMethod ( passed ) ; System.out.println ( passed ? PASS : FAIL ) ;
Question
Consider the following code fragment:
boolean passed false;
someMethodpassed;
System.out.printlnpassed "PASS" : "FAIL"; LINE
What will LNE print out to the console after the above code fragment
runs?
Wote: the condition valIfTrue : valiffalse operator is called the
"ternary" operator and works like a very compact ifelse
PASS
FAIL
It can be either PASS or FAIL It depends on the implementation
of somelethod
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
