JAVA Strings What will be the output of the following program code?class LogicalCompare{ public static void main(String args[]){ String str1 = new String("OKAY"); String str2 = new String(str1); System.out.println(str1 == str2); }} false 0 Displays error message 1 true false 0 Displays error message 1 true ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings What is the output of the following println statement?String str1 = "Hellow";System.out.println(str1.indexOf('t')); 0 false true 1 -1 0 false true 1 -1 ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings How many Constructor String class have? 2 13 11 None of this 7 2 13 11 None of this 7 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 twoone onetwo None of these one two twoone onetwo None of these 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); } } Runtime exception thrown Compilation error abc 123 Runtime exception thrown Compilation error abc 123 ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings String str1 = "Kolkata".replace('k', 'a');In the above statement, the effect on string Kolkata is The first occurrence of k is replaced by a. All characters a are replaced by k. Displays error message All characters k are replaced by a. The first occurrence of k is replaced by a. All characters a are replaced by k. Displays error message All characters k are replaced by a. ANSWER DOWNLOAD EXAMIANS APP