Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package zadanie5;
- /**
- *
- * @author Student
- */
- public class Calendar {
- private int year;
- private int mounth;
- private int day;
- public Calendar(int day, int mounth, int year) throws Exception{
- if(mounth < 1 || mounth > 12)
- throw new Exception("Date problem - mounth");
- if(((year == 0 || year % 4 == 0) && day > 29) || ((year != 0 || year % 4 != 0) && day > 28) )
- throw new Exception("Date problem - mounth - February");
- this.year = year;
- this.mounth = mounth;
- this.day = day;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement