Write a class called Time that includes five fields: year, month, day, minutes and seconds. This class
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a class called Time that includes five fields: year, month, day, minutes and seconds. This class stores information about a single point in time. Your class should have constructor(s), accessors and mutators, and it should implement the Comparable interface. Years take precedence over months, which take precedence over days etc. For example, Feb 19, 2016 comes after Nov 20, 2015.
Write a client class TimeTest that creates 3 instances of class Time, initializes them with random values (you can specify the values yourself or use Math.random() function), adds them to ArrayList and sorts the list (you can use Collections.sort()).
Related Book For
Data Analysis and Decision Making
ISBN: 978-0538476126
4th edition
Authors: Christian Albright, Wayne Winston, Christopher Zappe
Posted Date: