I am trying to find out someones age. I am following the answer given in here:
How do I calculate someone's age in Java?
This is what I have so far:
public void setDOB(String day, String month, String year){
LocalDate birthDate = new LocalDate(Integer.parseInt(year), Integer.parseInt(month), Integer.parseInt(day));
}
I am getting a an error when declaring the birthDate variable. I am getting the following error:
LocalDate(int,int,int) has private access in LocalDate
.
I don't know what this error means but I am assuming its to do with data access (e.g. private, public, etc)
No comments:
Post a Comment