11:17 pm - Sunday February 19, 2017

Date in java example program for before(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 before(Date when)
 **/

import java.util.Date;

public class Before {
	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 before date d1: " + c);
		c = d1.before(d2);
		System.out.println("Date d1 is before date d2: " + c);
	}
}

Output

Date d2 is before d1: false
Date d1 is before d2: true

BACK


							
							
			
Filed in: Z-A All Java Codes

Comments are closed.