/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.time.*;
import java.text.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public static boolean validarDataDate
(Date dataAtual,
Date dataRemota,
Date dataNascimento
) {
return dataNascimento.after(dataRemota) || dataNascimento.before(dataAtual);
}
public static boolean validarDataLocalDate(LocalDate dataAtual, LocalDate dataRemota, LocalDate dataNascimento) {
return dataNascimento.isAfter(dataRemota) || dataNascimento.isBefore(dataAtual);
}
{
System.
out.
println(validarDataDate
(dataAtual, dataRemota, dataNascimento
));
LocalDate localDataAtual = LocalDate.now();
LocalDate localDataNascimento = LocalDate.of(1998, 3, 27);
LocalDate localDataRemota = LocalDate.of(1990, 1, 1);
System.
out.
println(validarDataLocalDate
(localDataAtual, localDataRemota, localDataNascimento
));
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnRpbWUuKjsKaW1wb3J0IGphdmEudGV4dC4qOwoKLyogTmFtZSBvZiB0aGUgY2xhc3MgaGFzIHRvIGJlICJNYWluIiBvbmx5IGlmIHRoZSBjbGFzcyBpcyBwdWJsaWMuICovCmNsYXNzIElkZW9uZQp7CgkKICAgIHB1YmxpYyBzdGF0aWMgYm9vbGVhbiB2YWxpZGFyRGF0YURhdGUoRGF0ZSBkYXRhQXR1YWwsIERhdGUgZGF0YVJlbW90YSwgRGF0ZSBkYXRhTmFzY2ltZW50bykgewoKICAgICAgICByZXR1cm4gZGF0YU5hc2NpbWVudG8uYWZ0ZXIoZGF0YVJlbW90YSkgfHwgZGF0YU5hc2NpbWVudG8uYmVmb3JlKGRhdGFBdHVhbCk7CiAgICB9CgogICAgcHVibGljIHN0YXRpYyBib29sZWFuIHZhbGlkYXJEYXRhTG9jYWxEY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