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);}} Hellow Compilation error None of these Throws an exception Hello Hellow Compilation error None of these Throws an exception Hello 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. Compilation fails. "1" is printed. An exception is thrown at runtime. "3" is printed. "2" is printed. Compilation fails. "1" is printed. An exception is thrown at runtime. "3" is printed. ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings What will be the output?1. public class Test{2. public static void main(String args[]){3. Object myObj = new String[]{"one", "two", "three"};4. {5. for(String s : (String[])myObj) 6. System.out.print(s + ".");7. }8. }9. } None of these An exception is thrown at runtime. Compilation fails because of an error at line 5 Compilation fails because of an error at line 3 one.two.three. None of these An exception is thrown at runtime. Compilation fails because of an error at line 5 Compilation fails because of an error at line 3 one.two.three. 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,false false,false true,true false,true None of these true,false false,false true,true false,true ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings How many objects will be created?String a = new String("Examveda");String b = new String("Examveda");String c = "Examveda";String d = "Examveda"; 4 3 None of this 2 4 3 None of this 2 ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings How many Constructor String class have? 2 7 None of this 13 11 2 7 None of this 13 11 ANSWER DOWNLOAD EXAMIANS APP