Java tutorial
//package com.java2s; import java.util.StringTokenizer; public class Main { public static Integer[] getMinSec(String str) { Integer[] data = new Integer[2]; StringTokenizer tokens = new StringTokenizer(str, ","); int counter = 0; while (tokens.hasMoreTokens()) { String next = tokens.nextToken(); data[counter++] = Integer.valueOf(next); } return data; } }