Exemple de méthode java.time.Month.minLength ()

La description

le java.time.Month.minLength() La méthode obtient la durée minimale de ce mois en jours.

Déclaration

Voici la déclaration pour java.time.Month.minLength() méthode.

public int minLength()

Valeur de retour

la durée minimale de ce mois en jours, de 28 à 31.

Exemple

L'exemple suivant montre l'utilisation de la méthode java.time.Month.minLength ().

package com.tutorialspoint;

import java.time.Month;

public class MonthDemo {
   public static void main(String[] args) {
 
      Month month = Month.FEBRUARY;
      System.out.println(month.minLength());  
   }
}

Compilons et exécutons le programme ci-dessus, cela produira le résultat suivant -

28