JAVA Strings What is the output of the following println statement?String str1 = "Hellow";System.out.println(str1.indexOf('t')); 1 -1 false true 0 1 -1 false true 0 ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings toString() method is defined in java.lang.String java.lang.Object java.lang.util None of these java.lang.String java.lang.Object java.lang.util None of these ANSWER DOWNLOAD EXAMIANS APP
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)); }} Throws Exception true false 0 Compilation error Throws Exception true false 0 Compilation error ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings What will be the output of the following program code?public class Test{ public static void main(String args[]){ String s = "what"; StringBuffer sb = new StringBuffer("what"); System.out.print(sb.equals(s)+","+s.equals(sb)); }} false,false true,false true,true false,true None of these false,false true,false true,true false,true None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings The String method compareTo() returns 1 true false -1 an int value 1 true false -1 an int value 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. An exception is thrown at runtime. "1" is printed. "2" is printed. Compilation fails. "3" is printed. An exception is thrown at runtime. "1" is printed. "2" is printed. ANSWER DOWNLOAD EXAMIANS APP