Java How To Program (Early Objects) (10th Edition)
10th Edition
ISBN: 9780133807806
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
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...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents 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)
Ch. 1 - Computers process data under the control of sets...Ch. 1 - Prob. 1.2SRECh. 1 - Prob. 1.3SRECh. 1 - The programs that translate high-level language...Ch. 1 - Prob. 1.5SRECh. 1 - software is generally feature complete,...Ch. 1 - Prob. 1.7SRECh. 1 - Prob. 2.1SRECh. 1 - The command from the JDK compiles a Java program.Ch. 1 - A Java source code file must end with thefile...
Ch. 1 - When a Java program is compiled, the file produced...Ch. 1 - The file produced by the Java compiler...Ch. 1 - Prob. 3.1SRECh. 1 - Java programmers concentrate on creating, which...Ch. 1 - Prob. 3.3SRECh. 1 - A new class of objects can be created conveniently...Ch. 1 - is a graphical language that allows people who...Ch. 1 - The size, shape, color and weight of an object are...Ch. 1 - Prob. 1.1ECh. 1 - Prob. 1.2ECh. 1 - Prob. 1.3ECh. 1 - Prob. 1.4ECh. 1 - Prob. 1.5ECh. 1 - Prob. 1.6ECh. 1 - Prob. 1.7ECh. 1 - languages are most convenient to the programmer...Ch. 1 - The only language a computer can directly...Ch. 1 - Prob. 1.10ECh. 1 - Theprogramming language is now used to develop...Ch. 1 - initially became widely known as the development...Ch. 1 - Prob. 2.3ECh. 1 - Theprogramming language was developed by Bjarne...Ch. 1 - Java programs normally go through five...Ch. 1 - Prob. 3.2ECh. 1 - Prob. 3.3ECh. 1 - A(n)is a software application that simulates a...Ch. 1 - Thetakes the .class files containing the programs...Ch. 1 - Prob. 3.6ECh. 1 - Explain the two compilation phases of Java...Ch. 1 - Prob. 5ECh. 1 - Prob. 1MDCh. 1 - Prob. 2MDCh. 1 - (Attributes of Hybrid Vehicles) In this chapter...Ch. 1 - Prob. 4MD
Knowledge Booster
Similar questions
- A wristwatch is a common adornment. Consider applying the principles of object, attributes, behaviors, class, inheritance (imagine an alarm clock), modeling, messaging, encapsulation, interface, and information hiding to the notion of a watch.arrow_forwardThank Youarrow_forwardA wristwatch is a very common item. Discuss how object, attributes, behaviors, class, inheritance (imagine an alarm clock), modeling, messaging, encapsulation, interface, and information hiding apply to the idea of a watch.arrow_forward
- Design a object-oriented program using the following: inheritance, this, super, overriding, overloading, scanner, 5 classesarrow_forwardListen In an object-oriented design using UML, basic relationships, whereas objects. Blank # 1 Blank # 2 diagrams are used to represent classes and their diagrams are used to represent communication between A/ Aarrow_forwardExplain the concept of multiple interfaces in a single class. What benefits and challenges does this present?arrow_forward
- Explain why interfaces are better than simple classes.arrow_forwardobject oriented programming (oop) please give me full answer thanks Learning Objective:1. Classes and Object Creation 2. Access specifies. How to use it? 3. What is Constructor. 4. Practical walk through. 5. ExercisesClasses and Objects A class is like a blueprint of data member and functions and object is an instance of class. For example, let’s say we have a class Car which has data members (variables) such as speed, weight, price and functions such as gearChange(), slowDown(), brake() etc. Now let’s say I create a object of this class named FordFigo which uses these data members and functions and give them its own values. Similarly, we can create as many objects as we want using the blueprint(class)class Car { //Data members char name[20]; int speed; int weight; public: //Functions void brake(){ } void slowDown(){ } }; int main() { //ford is an object Car ford; } Access specifies (Private, Public and protected) The body of the class contains two unfamiliar keywords: private and…arrow_forwardCommon object behavior can be expressed using interfaces or abstract classes.What elements should you take into account when choosing between using an interface and an abstract class?arrow_forward
- When it comes to object-oriented programming, one question that often comes up is why it is necessary to put in more effort and code in order to prevent having classes that are connected together unnecessarily. What would you say are the three most essential reasons for taking the position that you do?arrow_forwardShould Object Oriented be defined in its own right? creating software with an eye for objectsarrow_forwardUse of interfaces has many benefits. The creation of objects of a certain class seems to be the simplest solution.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Principles of Information Systems (MindTap Course...Computer ScienceISBN:9781285867168Author:Ralph Stair, George ReynoldsPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
Principles of Information Systems (MindTap Course...
Computer Science
ISBN:9781285867168
Author:Ralph Stair, George Reynolds
Publisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT