JAVA Strings The class string belongs to ................. package. java.applet java.string java.awt java.lang java.applet java.string java.awt java.lang ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings What will be the output?String str1 = "abcde";System.out.println(str1.substring(1, 3)); bc bcd abc None of these abcd bc bcd abc None of these abcd ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings What could be output of the following fragment of code?public class Test{ public static void main(String args[]){ String x = "hellow";int y = 9;System.out.println(x += y); } } Throws an exception as string and int are not compatible for addition Compilation error 9hellow None of these hellow9 Throws an exception as string and int are not compatible for addition Compilation error 9hellow None of these hellow9 ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings String str1 = "Kolkata".replace('k', 'a');In the above statement, the effect on string Kolkata is Displays error message All characters a are replaced by k. The first occurrence of k is replaced by a. All characters k are replaced by a. Displays error message All characters a are replaced by k. The first occurrence of k is replaced by a. All characters k are replaced by a. 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 How many Constructor String class have? 7 11 13 2 None of this 7 11 13 2 None of this ANSWER DOWNLOAD EXAMIANS APP