ENCAPSULATION is the grouping of data items and functions into a type. By this we mean, if you have operations you want to perform on a student, you would sum them up, both the properties of the student and the operations you want to perform on them and encapsulate them into a class.
So we would have the class student that can contain properties like
i. Name
ii. Age etc.
And also operations like
i. AssignStudentID
ii. ChangeDepartment etc.
This would make it more organized and resuable.
That's the advantage of encapsulation.
What is Encapsulation?
About author: Toby [theITguy]
Cress arugula peanut tigernut wattle seed kombu parsnip. Lotus root mung bean arugula tigernut horseradish endive yarrow gourd. Radicchio cress avocado garlic quandong collard greens.
Subscribe to:
Post Comments (Atom)
0 comments: