JAVA Strings What is the output of the following println statement?String str1 = "Hellow";System.out.println(str1.indexOf('t')); 1 false -1 true 0 1 false -1 true 0 ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings The String method compareTo() returns an int value -1 1 true false an int value -1 1 true false ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings What will be output?String S1 = "S1 ="+ "123"+"456";String S2 = "S2 ="+(123+456); S1=123456, S2=579 None of This S1=579,S2=579 S1=123456,S2=123456 S1=123456, S2=579 None of This S1=579,S2=579 S1=123456,S2=123456 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)); }} None of these true,true true,false false,false false,true None of these true,true true,false false,false false,true ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings What will be the output of the following program code?class LogicalCompare{ public static void main(String args[]){ String str1 = new String("OKAY"); String str2 = new String(str1); System.out.println(str1 == str2); }} 1 true Displays error message 0 false 1 true Displays error message 0 false 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)); }} Compilation error Throws Exception false true 0 Compilation error Throws Exception false true 0 ANSWER DOWNLOAD EXAMIANS APP