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

🎓
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
  • 200 Questions with Detailed Solutions
  • Section-wise Coverage (GA, English, Quant & Reasoning)