Skip to content

Commit c96230b

Browse files
Merge pull request #5 from ismailbaskin/patch-1
Fix the answer of the ternary question
2 parents 2aa9dd2 + 27be155 commit c96230b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: java-multiple-choice-questions-answers.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -461,10 +461,10 @@ B. 2
461461
C. 3
462462
D. 6
463463
```
464-
A. 1
464+
D. 6
465465
```
466-
**Explanation**: In ternary expressions, only one of the two right-most expressions are evaluated. Since `meal>6` is false, `––tip` is evaluated and `++tip` is skipped. The result is that `tip` is changed from 2 to 1.
467-
466+
**Explanation**: In ternary expressions, only one of the two right-most expressions are evaluated. Since `meal>6` is false, `––tip` is evaluated and `++tip` is skipped. `tip` is changed from 2 to 1 and `total` becomes `meal + (1)` which means `5 + 1 = 6`.
467+
468468
## Q. What is the output of the following application?
469469
```java
470470
String john = "john";

0 commit comments

Comments
 (0)