"java's date(…) constructor is deprecated; what does that mean?" Code Answer

1

deprecated literally means disapproved of, but a more accurate translation would be retired. deprecated means this method is still usable, but you should not use it. it will gradually be phased out. there is a new method to do the same thing. deprecated methods are marked with a special javadoc comment:

/**
 *@deprecated please now use newmethod()
 *@see newmethod()
 */

use:

  • calendar.set(year + 1900, month, date, hrs, min)

or

  • gregoriancalendar(year + 1900, month, date, hrs, min).

as suggested by the api documentation.

By Reshil on March 28 2022
Only authorized users can answer the Search term. Please sign in first, or register a free account.