Tuesday 11 June 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

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...