Write a class, TimedInstantiation, which will have a toString method which returns a string of the following form:
I was instantiated on 12 June 2008, 35 seconds after the previous instantiation of me.
if there have been previous instantiations, but if not (that is, if we are dealing with the first instantiation) it should return
I was instantiated on 12 June 2008, and I am the first instantiation.
The following class might be useful:
java.util.Date represents dates. Its toString() method returns the date and time in human readable form: getTime() returns a long representing the date in milliseconds, so that
(d1.getTime() - d2.getTime())/1000L
will be the time in seconds between dates d1 and d2. Finally, new Date() will return the current date and time.