Exercise 1: public static void foo (boolean a) boolean b false; bar (a, b) boole
ID: 3585970 • Letter: E
Question
Exercise 1: public static void foo (boolean a) boolean b false; bar (a, b) boolean d = true ; soo(d, "d") public static void main (String[] args) foo (true) foo (false) System.out.print ("All done!") public static void bar (boolean a, boolean b) if (a && b) System.out.println ("a and b are true") else if (a) ( else if (b) ( else System.out.println ("a is true") System. out.println ("b is true" System.out.println ("a and b are false") boolean c false soo (c, "c") public static void soo (boolean e, String variableName) if (e) System.out.println (variableName+ "is true") else ( System.out.println (variableName+ "is false")Explanation / Answer
The output of the above code is as follows:
a is true
c is false
d is true
a and b are false
c is false
d is true
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.