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
strings
:
Content language: English
Русский
Here is a code: public static void doIt(String String) { //1 int i = 10; i : for (int k = 0 ; k< 10; k++) { //2 System.out.println( String + i); //3 if( k*k > 10) continue i; //4 } }
strings
What will be the output of following program, if compiled and run using below command: java Split1 a1+b3-c5=4x [12345][+-=] public class Split1 { public static void main(String[] args){ System.out.println((args[0].split(args[1])).length); } }
strings
How many objects are going to be created as a result of the following operation? "a"+"b"
strings
What will be the result of compilation and execution of the following code: class User { private int id = 0; private String name; private String surname; public User () {} public User (int id, String name, String surname) { this.id = id; this.name = name; this.surname = surname; } Override public boolean equals (Object obj) { if (this == obj) return true; if (obj == null ||! getClass (). equals (obj.getClass ())) return false; User u = (User) obj; return id == u.id & Amp; & amp; name == u.name || (name! = null & amp; & amp; name.equals (u.name)) & Amp; & amp; surname == u.surname || (surname! = null & amp; & amp; surname.equals (u.surname)); } Override public int hashCode () { return id + name == null? 0: name.hashCode () + surname == null? 0: surname.hashCode (); } public static void main (String args []) { User u1 = new User (12, "name", null); User u2 = new User (12, null, "name"); System.out.println (u1.hashCode () == u2.hashCode ()); System.out.println (u1.equals (u2)); } } </ Code> </ pre>
strings
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 ) ); } }
strings
Choose the correct result of compiling and running following code: import java.util.Formatter; public class Format2 { public static void main(String[] args) { String s = "hello123"; Formatter f = new Formatter(); f.format("%S", s); System.out.println(f); } }
strings
What will the following code print out? public class My { public static void main(String...args) { Integer i1 = new Integer("013"); Integer i2 = new Integer(013); System.out.println(i1 == i2); System.out.println(i1.equals(i2)); } }
strings
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 ) ); } }
strings
What will be the result of compilation and execution of the following code? Integer i = new Integer("10"); if (i.toString() == i.toString()) System.out.println("Equal"); else System.out.println("Not Equal");
strings
Consider following code: $var = 1 + "-1.3e3"; echo $var; What will be the result of the code above?
strings
← Prev
1
2
3
4
5
Next →
Sign Up Now
or
Subscribe for future quizzes