JAVA Strings What will be the output of the following program?public class Test{ public static void main(String args[]){String str1 = "one";String str2 = "two";System.out.println(str1.concat(str2)); }} two one None of these onetwo twoone two one None of these onetwo twoone ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings String str1 = "Kolkata".replace('k', 'a');In the above statement, the effect on string Kolkata is All characters k are replaced by a. The first occurrence of k is replaced by a. All characters a are replaced by k. Displays error message All characters k are replaced by a. The first occurrence of k is replaced by a. All characters a are replaced by k. Displays error message ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings The String method compareTo() returns true -1 an int value false 1 true -1 an int value false 1 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. } An exception is thrown at runtime. None of these Compilation fails because of an error at line 3 one.two.three. Compilation fails because of an error at line 5 An exception is thrown at runtime. None of these Compilation fails because of an error at line 3 one.two.three. Compilation fails because of an error at line 5 ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings How many Constructor String class have? 2 None of this 13 7 11 2 None of this 13 7 11 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)); }} true,false false,true false,false None of these true,true true,false false,true false,false None of these true,true ANSWER DOWNLOAD EXAMIANS APP