Guest User

Untitled

a guest
May 21st, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. class Date {
  2.  
  3. private int day;
  4. private int month;
  5. private int year;
  6.  
  7. public Date() {
  8. }
  9.  
  10. public Date(int day, int month, int year) {
  11. this.day = day;
  12. this.month = month;
  13. this.year = year;
  14. }
  15.  
  16. public int getDay() {
  17. return this.day;
  18. }
  19.  
  20. public int getMonth() {
  21. return this.month;
  22. }
  23.  
  24. public int getYear() {
  25. return this.year;
  26. }
  27.  
  28. public void setDay(int day) {
  29. day = enteredDay;
  30. }
  31.  
  32. public void setMonth(int month) {
  33. month = enteredMonth;
  34. }
  35.  
  36. public void setYear(int year) {
  37. year = enteredYear;
  38. }
  39.  
  40. public String toString() {
  41. return getDay() + "/" + getMonth() + "/" + getYear();
  42. }
  43.  
  44. public boolean isEarlier(Date) {
  45. if (enteredDay.getDay() < day) {
  46. return true;
  47. } else {
  48. return false;
  49. }
  50. }
Add Comment
Please, Sign In to add comment