Checking if a date exists or not in Java

Is there any predefined class in Java such that, if I pass it a date it should return if it is a valid date or not? For example if I pass it 31st of February of some year, then it should return false, and if the date exists then it should return me true, for any date of any year.

And I also want a method that would tell me what weekday this particular date is. I went through the Calender class but I didn't get how to do this.

6
задан halfer 2 May 2017 в 16:54
поделиться