Computer Applications
Which of the Object Oriented programming principles explain the following illustrations? Justify.
(a) The variables and methods are put together in a Class.
(b) A man withdrawing money from ATM.
OOP Intro Java
21 Likes
Answer
(a) Encapsulation is illustrated in the given picture. Wrapping of data and functions of an object as a unit (class) that can be used together in a specific operation is known as Encapsulation. In the picture, the variables and methods are being encapsulated in a class.
(b) The principle of Data abstraction is illustrated here as the man withdraws money from the ATM using the withdraw option. He knows the essential features of the ATM machine such as withdrawing money, without knowing the complex background details of how the ATM machine is operating to provide money to him.
Answered By
11 Likes