Tuesday, June 11, 2019

java - LocalDate has private access in LocalDate

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

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...