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 Runtime exception thrown abc 123 Compilation error Runtime exception thrown abc 123 ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings The class string belongs to ................. package. java.string java.awt java.lang java.applet java.string java.awt java.lang java.applet 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 None of these onetwo two twoone one None of these onetwo two twoone ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings What is the output of the following println statement?String str1 = "Hellow";System.out.println(str1.indexOf('t')); true 1 0 -1 false true 1 0 -1 false 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 Determine output:public class Test{ public static void main(String args[]){ String str = null; if(str.length() == 0){ System.out.print("1"); } else if(str == null){ System.out.print("2"); } else{ System.out.print("3"); } }} "1" is printed. "2" is printed. Compilation fails. An exception is thrown at runtime. "3" is printed. "1" is printed. "2" is printed. Compilation fails. An exception is thrown at runtime. "3" is printed. ANSWER DOWNLOAD EXAMIANS APP