Author Question: Explain the role of interface in encapsulation. Explain by providing examples. What will be an ... (Read 32 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 are more bacteria in your mouth than there are people in the world.

Did you know?

Barbituric acid, the base material of barbiturates, was first synthesized in 1863 by Adolph von Bayer. His company later went on to synthesize aspirin for the first time, and Bayer aspirin is still a popular brand today.

Did you know?

There are major differences in the metabolism of morphine and the illegal drug heroin. Morphine mostly produces its CNS effects through m-receptors, and at k- and d-receptors. Heroin has a slight affinity for opiate receptors. Most of its actions are due to metabolism to active metabolites (6-acetylmorphine, morphine, and morphine-6-glucuronide).

Did you know?

Many of the drugs used by neuroscientists are derived from toxic plants and venomous animals (such as snakes, spiders, snails, and puffer fish).

Did you know?

Studies show that systolic blood pressure can be significantly lowered by taking statins. In fact, the higher the patient's baseline blood pressure, the greater the effect of statins on his or her blood pressure.

For a complete list of videos, visit our video library