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

Approximately 15–25% of recognized pregnancies end in miscarriage. However, many miscarriages often occur before a woman even knows she is pregnant.

Did you know?

Vampire bats have a natural anticoagulant in their saliva that permits continuous bleeding after they painlessly open a wound with their incisors. This capillary blood does not cause any significant blood loss to their victims.

Did you know?

The familiar sounds of your heart are made by the heart's valves as they open and close.

Did you know?

Adults are resistant to the bacterium that causes Botulism. These bacteria thrive in honey – therefore, honey should never be given to infants since their immune systems are not yet resistant.

Did you know?

The average human gut is home to perhaps 500 to 1,000 different species of bacteria.

For a complete list of videos, visit our video library