Q. What will be the output?
public class Test{
public static void main (String[] args){
String test = "a1b2c3";
String[] tokens = test.split("\\d");
for(String s: tokens)
System.out.print(s);
}
}

  • (A) abc
  • (B) 123
  • (C) Runtime exception thrown
  • (D) Compilation error
πŸ’¬ Discuss
βœ… Correct Answer: (A) abc

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
123
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Vinay
Publisher
πŸ“ˆ
94%
Success Rate