JAVA Strings What is the output of the following println statement?String str1 = "Hellow";System.out.println(str1.indexOf('t')); 1 0 false -1 true 1 0 false -1 true 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"; 3 None of this 2 4 3 None of this 2 4 ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings The String method compareTo() returns false -1 1 an int value true false -1 1 an int value true 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); } } Compilation error abc 123 Runtime exception thrown Compilation error abc 123 Runtime exception thrown 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 s1 = "java";String s2 = "java";System.out.println(s1.equals(s2));System.out.println(s1 == s2); }} false false true true false true true false false false true true false true true false ANSWER DOWNLOAD EXAMIANS APP
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);}} Throws an exception Hello None of these Compilation error Hellow Throws an exception Hello None of these Compilation error Hellow ANSWER DOWNLOAD EXAMIANS APP