JAVA Strings The class string belongs to ................. package. java.applet java.awt java.string java.lang java.applet java.awt java.string java.lang ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings What will be the output?String str1 = "abcde";System.out.println(str1.substring(1, 3)); bc abcd None of these abc bcd bc abcd None of these abc bcd ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings How many Constructor String class have? 11 2 13 None of this 7 11 2 13 None of this 7 ANSWER DOWNLOAD EXAMIANS APP
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); }} true 1 Displays error message 0 false true 1 Displays error message 0 false 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); } } 123 Runtime exception thrown abc Compilation error 123 Runtime exception thrown abc Compilation error 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