JAVA Strings The class string belongs to ................. package. java.lang java.string java.awt java.applet java.lang java.string java.awt java.applet ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings Determine output:public class Test{ public static void main(String args[]){ String s1 = "SITHA";String s2 = "RAMA";System.out.println(s1.charAt(0) > s2.charAt(0)); }} Compilation error Throws Exception true false 0 Compilation error Throws Exception true false 0 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"); } }} Compilation fails. An exception is thrown at runtime. "2" is printed. "1" is printed. "3" is printed. Compilation fails. An exception is thrown at runtime. "2" is printed. "1" is printed. "3" is printed. ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings What is the output of the following println statement?String str1 = "Hellow";System.out.println(str1.indexOf('t')); true false -1 0 1 true false -1 0 1 ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings toString() method is defined in java.lang.Object java.lang.String java.lang.util None of these java.lang.Object java.lang.String java.lang.util None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Strings What could be output of the following fragment of code?public class Test{ public static void main(String args[]){ String x = "hellow";int y = 9;System.out.println(x += y); } } Throws an exception as string and int are not compatible for addition Compilation error None of these hellow9 9hellow Throws an exception as string and int are not compatible for addition Compilation error None of these hellow9 9hellow ANSWER DOWNLOAD EXAMIANS APP