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
toString method
:
Content language: English
Русский
What will happen when the following code is compiled and executed? 00: package test; 01: public class Test { 02: public static void main(String [] args) { 03: Test test = new Test(); 04: System.out.println(test.toString()); 05: } 06: }
toString method
What is the result of the following program execution? public class A { public static void main(String[] args) { Boolean b1 = true; Boolean b2 = new Boolean("/false"); String s1 = "" + 1 + '+' + 1 + '=' + (1 + 1) + " is "; String s2 = s1 + b1 + '/' + b2; System.out.println(s2); } }
toString method
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 ) ); } }
toString method
← Prev
1
Next →
Sign Up Now
or
Subscribe for future quizzes