Q: Write down an abstract class Time1 having attributes (hours, minutes, seconds), containing no argument constructor, 3 argument constructor. Write down an abstract function time() that increments seconds by 1 if seconds are equal to 60 then increment minutes by 1 and set seconds to 0. If minutes become equal to 60 then increment hours by 1 and set minutes to 0. Write a function that compare 2 time objects and return true if they are equal otherwise returns false.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 18RQ
icon
Related questions
Question

Subject : object Orieted Programing  ..Netbean Java

Q: Write down an abstract class Time1 having attributes (hours, minutes, seconds), containing no argument constructor, 3 argument constructor. Write down an abstract function time() that increments seconds by 1 if seconds are equal to 60 then increment minutes by 1 and set seconds to 0. If minutes become equal to 60 then increment hours by 1 and set minutes to 0. Write a function that compare 2 time objects and return true if they are equal otherwise returns false.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Developing computer interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT