Author Question: Explain the role of interface in encapsulation. Explain by providing examples. What will be an ... (Read 40 times)

CQXA

  • Hero Member
  • *****
  • Posts: 546
Explain the role of interface in encapsulation. Explain by providing examples.
 
  What will be an ideal response?

Question 2

A ________ cipher processes the input elements continuously, producing output one element at a time as it goes along.
 
  What will be an ideal response?



ktidd

  • Sr. Member
  • ****
  • Posts: 319
Answer to Question 1

Encapsulation creates a black box that hides how the object works inside. What is inside the box is private; what the objects offer to outside entities are called its services. The collection of an object's services is called its interface. The brake pedal in a car is the interface that provides services (stops the car) while the mechanism that actually stops the car is encapsulated and hidden (the driver does not have to know the intricacy of it to be able to use the brake). Students may provide other examples such as keyboard for a computer as you type, you see the results on the screen without knowing what is happening in the black box inside the computer.

Answer to Question 2

stream



Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
 

Did you know?

There can actually be a 25-hour time difference between certain locations in the world. The International Date Line passes between the islands of Samoa and American Samoa. It is not a straight line, but "zig-zags" around various island chains. Therefore, Samoa and nearby islands have one date, while American Samoa and nearby islands are one day behind. Daylight saving time is used in some islands, but not in others—further shifting the hours out of sync with natural time.

Did you know?

Hippocrates noted that blood separates into four differently colored liquids when removed from the body and examined: a pure red liquid mixed with white liquid material with a yellow-colored froth at the top and a black substance that settles underneath; he named these the four humors (for blood, phlegm, yellow bile, and black bile).

Did you know?

Asthma is the most common chronic childhood disease in the world. Most children who develop asthma have symptoms before they are 5 years old.

Did you know?

Many supplement containers do not even contain what their labels say. There are many documented reports of products containing much less, or more, that what is listed on their labels. They may also contain undisclosed prescription drugs and even contaminants.

Did you know?

The training of an anesthesiologist typically requires four years of college, 4 years of medical school, 1 year of internship, and 3 years of residency.

For a complete list of videos, visit our video library