JAVA Strings The output of the following fraction of code ispublic class Test{ public static void main(String args[]){ String s1 = new String("Hello");String s2 = new String("Hellow");System.out.println(s1 = s2);}} None of these Hello Throws an exception Hellow Compilation error None of these Hello Throws an exception Hellow Compilation error ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings What will be the output of the following program?public class Test{ public static void main(String args[]){String str1 = "one";String str2 = "two";System.out.println(str1.concat(str2)); }} one two None of these twoone onetwo one two None of these twoone onetwo ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings toString() method is defined in java.lang.String java.lang.util None of these java.lang.Object java.lang.String java.lang.util None of these java.lang.Object ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings How many objects will be created?String a = new String("Examveda");String b = new String("Examveda");String c = "Examveda";String d = "Examveda"; 4 None of this 3 2 4 None of this 3 2 ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings What will be the output?1. public class Test{2. public static void main(String args[]){3. Object myObj = new String[]{"one", "two", "three"};4. {5. for(String s : (String[])myObj) 6. System.out.print(s + ".");7. }8. }9. } Compilation fails because of an error at line 5 Compilation fails because of an error at line 3 None of these one.two.three. An exception is thrown at runtime. Compilation fails because of an error at line 5 Compilation fails because of an error at line 3 None of these one.two.three. An exception is thrown at runtime. ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings What will be the output?public class Test{ public static void main (String[] args){ String test = "a1b2c3"; String[] tokens = test.split("\\d"); for(String s: tokens) System.out.print(s); } } abc Compilation error Runtime exception thrown 123 abc Compilation error Runtime exception thrown 123 ANSWER DOWNLOAD EXAMIANS APP