JAVA Strings The output of the following fraction of code ispublic class Test{ public static void main(String args[]){ String s1 = new String("Hello");String s2 = new String("Hellow");System.out.println(s1 = s2);}} Throws an exception Compilation error Hellow None of these Hello Throws an exception Compilation error Hellow None of these Hello 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 false Displays error message 0 1 true false Displays error message 0 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 false true false true true false true false false true false true true false true ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings The String method compareTo() returns -1 an int value 1 false true -1 an int value 1 false true ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings How many Constructor String class have? None of this 11 2 7 13 None of this 11 2 7 13 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,true true,false None of these false,false true,true false,true true,false None of these false,false true,true ANSWER DOWNLOAD EXAMIANS APP