5:19 pm - Sunday October 22, 2017

Date in java example program for clone()

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 for clone()
**/
import java.util.Date;
public class Clone
{
public static void main(String[] args)
{
Date d1 = new Date(90,10,5);
Object d2=d1.clone();
System.out.println("Original Date:" +d1.toString());
System.out.println("Cloned Date:" +d2.toString());
}
}

Output:
Original Date:Mon Nov 05 00:00:00 IST 1990
Cloned Date:Mon Nov 05 00:00:00 IST 1990

BACK

Filed in: Z-A All Java Codes

Comments are closed.