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)); }} true,false false,false true,true false,true None of these true,false false,false true,true false,true None of these 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 false false true false true true false true false false true false true true ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings What will be output?String S1 = "S1 ="+ "123"+"456";String S2 = "S2 ="+(123+456); S1=123456, S2=579 S1=579,S2=579 S1=123456,S2=123456 None of This S1=123456, S2=579 S1=579,S2=579 S1=123456,S2=123456 None of This ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings The String method compareTo() returns -1 1 false true an int value -1 1 false true an int value ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings How many Constructor String class have? 13 11 7 None of this 2 13 11 7 None of this 2 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"); } }} "2" is printed. "3" is printed. Compilation fails. "1" is printed. An exception is thrown at runtime. "2" is printed. "3" is printed. Compilation fails. "1" is printed. An exception is thrown at runtime. ANSWER DOWNLOAD EXAMIANS APP