After entering the date in the specified format as input. how can I get the day, month and year and include them in three distinct variables? I tried with getYear () but it gives me a mistake because it is deprecated, I read that you can with "Calendar" but I did not understand how to use it in this library
System.out.println("Inserisci la data [yyyy-MM-dd]: ");
Scanner in = new Scanner(System.in);
s = in.nextLine();
//converte la stringa della data in un oggetto di classe Date
SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");
Date d = formato.parse(s);