I want to extract people born between two years.
Being year1 = "1990"
and year2 = "2000"
. It seems that >=
and <=
doesn't work.
How can I compare these two date strings?
static void annesCom(Personne[] pers, int nbElem, String year1, String year2)
{
int i;
for(i=0; i < nbElem; i++)
if(perso[i].year() >= year1 && perso[i].year() <= year2 )
System.out.printf("Person %d) Born in %s\n", i, pers[i].year());
}