11:11 pm - Saturday May 27, 2017

Date in java example program for after(Date when)

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044
/**@author:candidjava
*@description:Date in java example program for after(Date when)
**/
import java.util.Date;
public class After
{
     public static void main(String[] args)
     {
       Date d1 = new Date(11, 5, 21);
       Date d2 = new Date(15, 1, 21);
       boolean c = d2.before(d1);
       System.out.println("Date d2 is after date d1: " + c);
       c = d1.after(d2);
       System.out.println("Date d1 is after date d2: " + c);
}
}

Output:
Date d2 is after date d1: false
Date d1 is after date d2: false

BACK

Filed in: Z-A All Java Codes

Comments are closed.