Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

age in java



public class AgeCalculator {

    public static int calculateAge(LocalDate birthDate, LocalDate currentDate) {
        if ((birthDate != null) && (currentDate != null)) {
            return Period.between(birthDate, currentDate).getYears();
        } else {
            return 0;
        }
    }
}


Source by coders911.org #
 
PREVIOUS NEXT
Tagged: #age #java
ADD COMMENT
Topic
Name
7+9 =