What is the output after compile and run the following code ?
int Output = 10;boolean b = false;if((b == true) && ((Output += 10) == 20)){ System.out.println("We are equal " + Output);}else{ System.out.println("Not equal! " + Output);}5
1036 5b5cc6cee4d2b4197774e2b4
Q: What is the output after compile and run the following code ? int Output = 10;boolean b = false;if((b == true) && ((Output += 10) == 20)){ System.out.println("We are equal " + Output);}else{ System.out.println("Not equal! " + Output);}
- 1Compilation and output of "We are equal 10"false
- 2Compilation and output of "Not equal! 10"true
- 3Compilation error, attempting to perform binary comparison on logical data typefalse
- 4Compilation and output of "Not equal! 20"false
- Show Answer
- Workspace
- Discuss