- 1
Output of program:
public class pq{ static boolean a; static boolean b; static boolean c; public static void main(String[] args) { boolean bool = (a = true) ||(b = true) && (c = true); System.out.print (a +"," + b + ","+ c); } }
4 Antworten
+ 2
No, java will calculate only (a = true) because after there is operator ‘or’, and other parts wouldn’t be calculated.
b, c = false because of default values.
+ 1
Hmm, what is it? 😒
You want output? Then: true, false, false.
0
it's short circuit evaluation..only a=true is calculated. b and c have default values which are false!! output is true false false
- 3
"true,true,true" /*quotes indicates type of String. */