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

The ratio of hydrogen atoms to oxygen in water (H2O) is 2:1.

Did you know?

The eye muscles are the most active muscles in the whole body. The external muscles that move the eyes are the strongest muscles in the human body for the job they have to do. They are 100 times more powerful than they need to be.

Did you know?

The first-known contraceptive was crocodile dung, used in Egypt in 2000 BC. Condoms were also reportedly used, made of animal bladders or intestines.

Did you know?

Long-term mental and physical effects from substance abuse include: paranoia, psychosis, immune deficiencies, and organ damage.

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