JAVA Strings Determine output:public class Test{ public static void main(String args[]){ String s1 = "SITHA";String s2 = "RAMA";System.out.println(s1.charAt(0) > s2.charAt(0)); }} true 0 false Compilation error Throws Exception true 0 false Compilation error Throws Exception 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"); } }} Compilation fails. "3" is printed. "1" is printed. "2" is printed. An exception is thrown at runtime. Compilation fails. "3" is printed. "1" is printed. "2" is printed. An exception is thrown at runtime. 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 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. Displays error message All characters a are replaced by k. ANSWER DOWNLOAD EXAMIANS APP
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)); bcd abc abcd None of these bc bcd abc abcd None of these bc 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 2 3 None of this 4 2 3 None of this ANSWER DOWNLOAD EXAMIANS APP