Quizzes
Site Language: English
Українська
English
Русский
Programming Tests
Login
Sign Up
Programming Tests
Theory
Snippets
Papers
Landing
Android
Prices
FAQ
Cosmo Story
Terms and Conditions
Privacy Policy
Cookies Policy
Send Feedback
booleans
:
Content language: English
Русский
What will be the output of the program import java.util.Formatter; public class Formatting { public static void main(String[] args) { Formatter formatter = new Formatter(); System.out.println( formatter.format("%b %b %b %b %b", true, null, "false", new Boolean("false"), 0) ); } }
booleans
What will be the output of the following code? class Main { public static void main(String[] args) { Boolean b1 = true; boolean b2 = false; boolean b3 = true; if ((b1 & b2) | (b2 & b3) & b3) System.out.print("alpha "); if((b1 = false) | (b1 & b3) | (b1 | b2)) System.out.print("beta "); } }
booleans
What will be the result of compilation and running the following code: import java.util.Formatter; public class Formating { static Formatter formatter = new Formatter(); public static void main(String[] args) { System.out.print( formatter.format("%b %b %b", new Boolean(null), new Boolean("bool"), 8 ) ); } }
booleans
What will be the output of the following code? public class Test { int i = 10; public int hashCode() { return i; } public static void main(String ... a) { System.out.println(String.format(" %1$b ", new Boolean("fAlSe")) ); System.out.println(String.format(" %1$H %2$s", new Test(), null ) ); } }
booleans
← Prev
1
2
Next →
Sign Up Now
or
Subscribe for future quizzes