JAVA Strings How many objects will be created?String a = new String("Examveda");String b = new String("Examveda");String c = "Examveda";String d = "Examveda"; 3 2 4 None of this 3 2 4 None of this ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings The class string belongs to ................. package. java.string java.lang java.applet java.awt java.string java.lang java.applet java.awt ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings String str1 = "Kolkata".replace('k', 'a');In the above statement, the effect on string Kolkata is All characters a are replaced by k. Displays error message All characters k are replaced by a. The first occurrence of k is replaced by a. All characters a are replaced by k. Displays error message All characters k are replaced by a. The first occurrence of k is replaced by a. ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings The String method compareTo() returns 1 an int value true false -1 1 an int value true false -1 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. An exception is thrown at runtime. "1" is printed. "3" is printed. "2" is printed. Compilation fails. An exception is thrown at runtime. "1" is printed. "3" is printed. "2" is printed. ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings What is the output of the following println statement?String str1 = "Hellow";System.out.println(str1.indexOf('t')); false -1 1 true 0 false -1 1 true 0 ANSWER DOWNLOAD EXAMIANS APP