I am not exactly sure how this is called and how it should be done, but I am learning Java and my assignment is to create a data class that will be able to add days to certain date and subtract and show the difference and so on. My current issue is that I want to implement a rule for every month of the year, I am sure this can be done differently, but I want to try and do this.
Let us say we are given the date in format Year, month, day. 2017.09.31 I want to check before it is printed if month 09 is allowed to have 31 days. So I wanted to go and write this:
if (MM==1 || MM==01);
where MM is month, to say that the value of day for MM can be in a range from 1-30, if the number D is in that range print the number D. Is there any function in Java that lets u use range in this manner?