Question: Consider the following code fragment: boolean passed = true; passed = someMethod ( passed ) ; System.out.println ( passed ? PASS : FAIL ) ;
Consider the following code fragment:
boolean passed true;
passed someMethodpassed;
System.out.printlnpassed "PASS" : "FAIL"; LINE
What will LINE print out to the console after the above code fragment runs?
Note: the condition valIfTrue : valIfFalse operator is called the "ternary" operator and works like a very compact ifelse
Group of answer choices
PASS
FAIL
It can be either PASS or FAIL. It depends on the implementation of someMethod
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
