Java How To Program (Early Objects) (10th Edition)
Java How To Program (Early Objects) (10th Edition)
10th Edition
ISBN: 9780133807806
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.
A wristwatch is one of the most often seen objects on the globe. Distinguish the relationship between the following language and concepts and the notion of a watch: object; attributes; behaviors; class; inheritance (as an example, consider the idea of an alarm clock); modeling; messages; encapsulation; interface; and information hiding.
Object-oriented concepts like encapsulation and polymorphism, and object models, are intertwined.

Chapter 1 Solutions

Java How To Program (Early Objects) (10th 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