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"); } }} An exception is thrown at runtime. Compilation fails. "1" is printed. "2" is printed. "3" is printed. An exception is thrown at runtime. Compilation fails. "1" is printed. "2" is printed. "3" is printed. ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings What will be the output?String str1 = "abcde";System.out.println(str1.substring(1, 3)); bc abcd bcd abc None of these bc abcd bcd abc 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); } } Compilation error 123 Runtime exception thrown abc Compilation error 123 Runtime exception thrown abc 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 true true true true false false false false true true true true false false false ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings How many Constructor String class have? None of this 2 7 11 13 None of this 2 7 11 13 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"; 4 None of this 3 2 4 None of this 3 2 ANSWER DOWNLOAD EXAMIANS APP