package com.arraylist.demo2;
import java.time.LocalDate;
import java.time.temporal.TemporalAdjusters;
public class Demo4 {
public static void main(String[] args) {
// 注意定义的 1 日期不能更改
LocalDate now =LocalDate.of(2001,2,1);
// 获取星期几
int week = now.getDayOfWeek().getValue();
now = now.with(TemporalAdjusters.lastDayOfMonth());
int dayOfMonth = now.getDayOfMonth();
System.out.print("天t");
System.out.print("一t");
System.out.print("二t");
System.out.print("三t");
System.out.print("四t");
System.out.print("五t");
System.out.println("六t");
for(int i =0;i
效果图



