使用使用LocalDate打印日历java代码:
import java.time.*; public class getDate { public static void main(String[] args) { System.out.println("Mon Tue Wed Thu Fir Sat Sun"); for(int i=1;i<value;i++) { System.out.print(" "); } while (date.getMonthValue() == month) { System.out.printf("%3d", date.getDayOfMonth()); if(date.getDayOfMonth() == today) { System.out.print("*"); } else { System.out.print(" "); } date = date.plusDays(1); if(date.getDayOfWeek().getValue() == 1) { System.out.println(); } } if(date.getDayOfWeek().getValue() != 1) { System.out.println(); } } }
执行结果:
【版权申明】未经博主同意,谢绝转载!(请尊重原创,博主保留追究权) https://www.cnblogs.com/facetwitter/p/17788261.html
标签:日历,java,打印,博主,LocalDate,public From: https://www.cnblogs.com/facetwitter/p/17788261.html