For each of the following classes be sure to includeappropriate fields, accessors, mutators(must checkfor appropriate values before changing fields), constructors,writeOutput methods and equals. Include additional methods asappropriate.
Part 1: Define a base class to represent a Clock. Your classshould have instance variables for hours, minutes and seconds.
Part 2: Define a derived class to represent an alarm clock. Usethe Clock class as your base class.
Part 3: Define a derived class of alarm clock.
Part 4: Create a test driver to test the functionality of yourAlarm Clock , Clock Class, and your custom class. Have anarray containing these objects.
Part 5: Create an interface that
OR
OR