You’re probably wearing on your wrist one of the world’s most common types 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 alarm clock), modeling, messages, encapsulation, interface and information hiding.
What will be an ideal response?
The entire watch is an object that is composed of many other objects (such as the moving parts, the band, the face, etc.) Watch attributes are time, color, band, style (digital or analog), etc. The behaviors of the watch include setting the time and get- ting the time. A watch can be considered a specific type of clock (as can an alarm clock). With that in mind, it is possible that a class called Clock could exist from which other classes such as watch and alarm clock could inherit the basic features in the clock. The watch is an abstraction of the mechanics needed to keep track of the time. The user of the watch does not need to know the mechanics of the watch in order to use it; the user only needs to know that the watch keeps the proper time. In this sense, the mechanics of the watch are encapsulated (hidden) inside the watch. The interface to the watch (its face and controls for setting the time) allows the user to set and get the time. The user is not allowed to directly touch the internal mechan- ics of the watch. All interaction with the internal mechanics is controlled by the in- terface to the watch. The data members stored in the watch are hidden inside the watch and the member functions (looking at the face to get the time and setting the time) provide the interface to the data.
You might also like to view...
After the following program is finished, how many bytes are written to the file t.dat?
``` import java.io.*; public class Test { public static void main(String[] args) throws IOException { DataOutputStream output = new DataOutputStream( new FileOutputStream("t.dat")); output.writeUTFString("ABCD"); output.close(); } } ``` a. 2 bytes. b. 4 bytes. c. 6 bytes. d. 8 bytes. e. 10 bytes.
In a database, a report is used to easily enter data
Indicate whether the statement is true or false
Base column widths can be changed by either using the click and drag technique or the double-click technique
Indicate whether the statement is true or false
Measurable Web site performance standards are often called _________________________.
Fill in the blank(s) with the appropriate word(s).