/* 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
{
if(dataEntrada.compareTo(dataReserva) >= 0 && dataSaida.compareTo(dataEntrada) > 0){
return "tudo certo";
}else{
return "algumas datas sao invalidas";
}
}
{
cal1.setTime(dataReserva);
cal2.setTime(dataEntrada);
cal3.setTime(dataSaida);
System.
out.
println(validarDataDate
(cal1, cal2, cal3
));// reserva menor que entrada que é menor que saida System.
out.
println(validarDataDate
(cal2, cal2, cal3
));// reserva igual a entrada que é menor que saida System.
out.
println(validarDataDate
(cal2, cal1, cal3
));// reserva maior que entrada que é menor que saida System.
out.
println(validarDataDate
(cal1, cal3, cal2
));// reserva menor que entrada que é maior que saida
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnRpbWUuKjsKaW1wb3J0IGphdmEudGV4dC4qOwoKLyogTmFtZSBvZiB0aGUgY2xhc3MgaGFzIHRvIGJlICJNYWluIiBvbmx5IGlmIHRoZSBjbGFzcyBpcyBwdWJsaWMuICovCmNsYXNzIElkZW9uZQp7CgkKICAgIHB1YmxpYyBzdGF0aWMgU3RyaW5nIHZhbGlkYXJEYXRhRGF0ZShDYWxlbmRhciBkYXRhUmVzZXJ2YSwgQ2FsZW5kYXIgZGF0YUVudHJhZGEsIENhbGVuZGFyIGRhdGFTYWlkYSkgewogICAgICAgIAogICAgICAgIGlmKGRhdGFFbnRyYWRhLmNvbXBhcmVUbyhkYXRhUmVzZXJ2YSkgPj0gMCAmJiBkYXRhU2FpZGEuY29tcGFyZVRvKGRhdGFFbnRyYWRhKSA+IDApewogICAgICAgIAlyZXR1cm4gInR1ZG8gY2VydG8iOwogICAgICAgIH1lbH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