I'm having a problem with the split function returning a blank array. When any index is called from the array, it throws an index out of bounds exception. Here is the code:
class splitNumber {
public static void main(String[] args) {
String number = "3.84";
String[] sep = number.split(".");
System.out.println(sep[0]);
}
}
Is there any fix or workaround for this? I'm using Java SE 7.