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. } Compilation fails because of an error at line 5 Compilation fails because of an error at line 3 An exception is thrown at runtime. one.two.three. None of these Compilation fails because of an error at line 5 Compilation fails because of an error at line 3 An exception is thrown at runtime. one.two.three. None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings What is the output of the following println statement?String str1 = "Hellow";System.out.println(str1.indexOf('t')); 1 0 false true -1 1 0 false true -1 ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings The String method compareTo() returns -1 an int value 1 true false -1 an int value 1 true false ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings How many Constructor String class have? 2 None of this 7 11 13 2 None of this 7 11 13 ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings The class string belongs to ................. package. java.lang java.awt java.string java.applet java.lang java.awt java.string java.applet ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings What will be the output?String str1 = "abcde";System.out.println(str1.substring(1, 3)); abcd abc None of these bc bcd abcd abc None of these bc bcd ANSWER DOWNLOAD EXAMIANS APP