Java How to Program, Early Objects Plus MyLab Programming with Pearson eText -- Access Card Package (11th Edition)
Java How to Program, Early Objects Plus MyLab Programming with Pearson eText -- Access Card Package (11th Edition)
11th Edition
ISBN: 9780134800271
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
Expert Solution & Answer
Book Icon
Chapter 1, Problem 5E

Explanation of Solution

Object

  • Depending on whether it is mechanical or electronic watch, there will be different design for power source location, watch casing, hands and watch protection.
  • The user check out from watch is position of its hands to read time.
  • The rest of watch’s functioning is encapsulated within the casing.
  • Before time of a watch is read, it must have been constructed from its engineer’s drawings or design plans.

Attributes

  • Apart from the ability to read time, it has attributes such as color, constituent material, power source and extra properties such as water resistant, size, its ability to keep track of date and month.
  • The watch’s attributes are representing part of its design in its engineering diagrams.
  • Every watch will maintain its own attributes.

Behavior

  • For a mechanical watch, the behavior or method hides the hand and wheel movement mechanism from the watch.
  • Behavior and method are similar terms.
  • Behavior house the same way as watch perform its tasks.

Class

  • A class is used to embody a set of methods that aid in performing class’s tasks.
  • A class can be seen as blueprints and in the case of watch, the engineering drawings or design plan from which watch class is created.
  • It will hence contain methods for reading, changing time and so on.

Inheritance

  • With inheritance, a new class can be created from the existing class.
  • The new class absorbs the characteristics of the existing class.
  • Alarm clock may contain general watch characteristics such as hands and timing parameters but at the same time it may have an extra customized alarm device...

Blurred answer
Students have asked these similar questions
You are probably wearing on your wrist one of the most commontypes of objects—a watch. Discuss how each of the following terms and concepts applies to the notion of a watch: object, attributes, behaviors, class, inheritance (consider, for example, an alarmclock), messages, encapsulation and information hiding.
Thank You
Explain briefly the following Object Oriented concepts.(a) Local variable(b) Instance variable(c) Method(d) Inheritance(e) Constructor(f) Encapsulation (getters and setters)(g) Method overloading(h) Method overriding(i) Super keyword(j) Interface

Chapter 1 Solutions

Java How to Program, Early Objects Plus MyLab Programming with Pearson eText -- Access Card Package (11th Edition)

Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Principles of Information Systems (MindTap Course...
Computer Science
ISBN:9781285867168
Author:Ralph Stair, George Reynolds
Publisher:Cengage Learning
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT