Here you can find the source of getAge(LocalDate birthDay)
Parameter | Description |
---|---|
LocalDate | a parameter |
public static int getAge(LocalDate birthDay)
//package com.java2s; //License from project: Apache License import java.time.LocalDate; public class Main { /**/*from w w w .j a v a 2 s .co m*/ * @param LocalDate * @return age in years */ public static int getAge(LocalDate birthDay) { return LocalDate.now().getYear() - birthDay.getYear(); } }