⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 日期.java

📁 java源程序,两个类之间的函数转换,实现相应功能
💻 JAVA
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package 阶段练习一;/** * * @author lenovo */public  class  日期{ int year,month,day;   日期(int a,int b,int c)   { year=a;     month=b;     day=c;   }   int 日期错误()   { if(month<0||month>12||day<0||day>31) return 0;     else return 1;   }   int 闰年()   { if(year%4==0||year%100!=0||year%400==0)return 1;     else return 0;//能被4整除并且不能被100整除或者是能被400整除的为闰年//   }   int 每月天数()   { switch (month)     {   case 1:         case 3:         case 5:         case 7:         case 8:         case 10:         case 12: return 31;         case 4:         case 6:         case 9:         case 11: return 30;         case 2: {if(闰年()==1) return 29; else return 28;}         default: break;     }     return 0;   }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -