Generation

generate functionWed, 16 Nov 2022

multidimentional matrix of a calendar, where days can contain a value

public class Calendar { private int[][] days; public Calendar(int year, int month) { int[] daysInMonth = new int[] {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int numDaysInMonth = daysInMonth[month]; days = new int[numDaysInMonth][]; for (int i = 0; i < numDaysInMonth; i++) { days[i] = new int[24]; } } }

Questions about programming?Chat with your personal AI assistant