Multiple choice

What is the output? public class sample5 { public static void main(String[] args) { String a = "Hi/there"; String n[] =a.split("/"); System.out.print(n[0] + " "); } }

  1. Hi there

  2. Hi-

  3. Hi

  4. there

  5. None of these

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Correct choice split(-) functions splits the string in two array indexes. So it prints index 0, which is correct.