Java Calendar Compare max(Calendar cal1, Calendar cal2)

Here you can find the source of max(Calendar cal1, Calendar cal2)

Description

max

License

LGPL

Declaration

public static Calendar max(Calendar cal1, Calendar cal2) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.util.Calendar;
import java.util.Date;

public class Main {
    public static Calendar max(Calendar cal1, Calendar cal2) {
        return cal1.after(cal2) ? cal1 : cal2;
    }/* w  w w .j  av a 2  s  .  c  om*/

    public static Date max(Date date1, Date date2) {
        return date1.after(date2) ? date1 : date2;
    }
}

Related

  1. isSameDate(java.util.Calendar date1, java.util.Calendar date2)
  2. isSameInstant(Calendar cal1, Calendar cal2)
  3. isSameInstant(Calendar cal1, Calendar cal2)
  4. isSameInstant(Calendar cal1, Calendar cal2)
  5. isSameInstant(final Calendar cal1, final Calendar cal2)
  6. min(Calendar c1, Calendar c2)
  7. min(final Calendar... calendars)
  8. minCalendars(List calendars)
  9. minimum(Calendar... calendars)