Write a program to calculate the age of a person in Java ( Please do it fast..!!)
Answers
Answered by
0
Answer:
In order to get the date of birth from the current date or any specific date, we should follow the steps given below.
Read from the user or input date of birth (DOB).
Convert the DOB to the LocalDate object.
Get the current date (as LocalDate object) by using the now() method.
Determine the period (difference) between the two dates (DOB and current date) by using the between() method.
There are the following three ways to calculate age:
Using Period Class
Using Enum ChronoUnit
Using Calendar Class
Using Joda Library
Explanation:
please give me 5 star
Similar questions