9
(Choose 1 answer)
A. EQUAL NOT EQUAL
B. NOT EQUAL
C. There is a compile error in the program.
D. EQUAL
}
What is the output when you try to compile and run the following program?
public class Main {
public static void main(String argv[]){
String s = "Hi there";int pos = s.indexOf(" ");
String r = s.substring(0, pos);
String s2 = new String(new char[] {'H',''});
if(r.equals(s2))
System.out.println("EQUAL");
else System.out.println("NOT EQUAL");
System.out.println();