java万年历源代码!!!!!!!!!任意年份
import java.util.Scanner;
public class Wnl { /** * @param args */ public static int year; // 年份 public static int month; // 月份 //构造函数 public Wnl() { Scanner input = new Scanner(System.in); System.out.println("输入您要的年份:"); year = input.nextInt(); System.out.println("输入您要的月份:"); month = input.nextInt(); if (!isYear(year)) { // 判断是不是有效年 System.out.println("年份输入有误,请重新输入") ; Wnl wnl = new Wnl(); } if (!isMonth(month)) { // 判断是不是有效月份 System.out.println("月份输入有误,请重新输入"); Wnl wnl = new Wnl(); } display(year, month);//输出日历 } // mian函数 public static void main(String[] args) { Wnl wnl = new Wnl(); //新建一个万年历对象 } // 判断是不是有效年 private static boolean isYear(int year) { boolean flag = false; if (year >= 1900) { flag = true; } return flag; } // 判断是不是闰年 private boo