Author Question: Explain the role of interface in encapsulation. Explain by providing examples. What will be an ... (Read 31 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?

Calcitonin is a naturally occurring hormone. In women who are at least 5 years beyond menopause, it slows bone loss and increases spinal bone density.

Did you know?

The top 10 most important tips that will help you grow old gracefully include (1) quit smoking, (2) keep your weight down, (3) take supplements, (4) skip a meal each day or fast 1 day per week, (5) get a pet, (6) get medical help for chronic pain, (7) walk regularly, (8) reduce arguments, (9) put live plants in your living space, and (10) do some weight training.

Did you know?

Urine turns bright yellow if larger than normal amounts of certain substances are consumed; one of these substances is asparagus.

Did you know?

In 1886, William Bates reported on the discovery of a substance produced by the adrenal gland that turned out to be epinephrine (adrenaline). In 1904, this drug was first artificially synthesized by Friedrich Stolz.

Did you know?

Though Candida and Aspergillus species are the most common fungal pathogens causing invasive fungal disease in the immunocompromised, infections due to previously uncommon hyaline and dematiaceous filamentous fungi are occurring more often today. Rare fungal infections, once accurately diagnosed, may require surgical debridement, immunotherapy, and newer antifungals used singly or in combination with older antifungals, on a case-by-case basis.

For a complete list of videos, visit our video library