I got a method that is like below
private double get_date_number(String day, String month, String year) {
// TODO Auto-generated method stub
date_array[0][0] = 6.18;
date_array[0][1] = 1.22;
date_array[0][2] = 6.26;
date_array[0][3] = 6.30;
return date_array[Integer.parseInt(month)-1][Integer.parseInt(day)-1];
}
and I’m calling it like below:
date_number = get_date_number(Day, Month, Year);
date_array is defined as double[][]
date_number is defined as double
If I return:
return date_array[0][2];
It works like a charm but if I do it like above the app crashes…
Can anyone help me please?
The bounds of your 2D array
date_arrayhas been exceeded. This more than likely is happening in the line that contains either :or
Check the values for
monthanddayand ensure that you have enough rows and columns respectively to match these.