Check out example codes for "java jagged array days and months". It will help you in understanding the concepts better.

Code Example 1

int[][] CalendarDays = new int[12][];

for(int i = 1; i <= 12; i++) {
  	// months with 30 days
	if(i == 4 || i == 6 || i = 9 || i == 11) {
		CalendarDays[i] = new int[30];
    // months with 28 days
	} else if(i == 2) {
		CalendarDays[i] = new int[28];
    // months with 31 days
	} else {
		CalendarDays[i] = new int [31];
	}
}

Learn ReactJs, React Native from akashmittal.com