I need some help; I've been stuck with this situation for a while. My goal is to display a calendar form for the month of August 2021. I have my code here. I only need the month of August since I just want to post a calendar of the month for users to see the date for the opening of classes. It displays the calendar, but I feel it has a more efficient way of writing this type of program, but I don't know how. Can you please help me?
Here is my code:
public class Calendar {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
System.out.println("\t\tMONTH OF AUGUST 2021");
System.out.println("–––––––––––––––-------------------------––––––––––––––");
System.out.println("\nSun\tMon\tTue\tWed\tThu\tFri\tSat\n");
System.out.println("–––––––––––––––-------------------------––––––––––––––");
int [][]num={{1,2,3,4,5,6,7},{8,9,10,11,12,13,14},{15,16,17,18,19,20,21},{22,23,24,25,26,27,28},{29,30,31,1,2,3,4}};
for (int i=1; i<num.length;i++){
for(int j=8; j<num[i].length; j++){
num[i][j]=i+j;
}
}
for(int[] a: num){
for(int i:a){
System.out.print(i + "\t");
}
System.out.println("\n");
}
}
}