Here you can find the source of getDataMaior(java.sql.Date data1, java.sql.Date data2)
Parameter | Description |
---|---|
data1 | a parameter |
data2 | a parameter |
public static java.sql.Date getDataMaior(java.sql.Date data1, java.sql.Date data2)
//package com.java2s; //License from project: Open Source License public class Main { /**// w w w . j a va2 s .c om * Compara 2 datas e retorna a maior, verificando os nulos. * * @param data1 * @param data2 * @return */ public static java.sql.Date getDataMaior(java.sql.Date data1, java.sql.Date data2) { if (data1 == null) return data2; if (data2 == null) return data1; if (data1.after(data2)) { return data1; } else { return data2; } } }