Question

Consider the following Java code: import java.util.Arrays; public class Splitter {     public static void main(String[] args) {         String data = "item1::value1::item2::value2";         String[] parts = data.split("::");         System.out.println(parts.length + " " + parts[1]);     } } What will be the output of this program?

A 4 value1
B 2 value1
C 4 item1
D 2 item2
E Compile-time error
Practice Next

Hey! Ask a query