AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
This insulation of data from the direct access of the program is called data hiding. The data is accessible only to those methods, which are wrapped in the class, and not to the outside world. The wrapping up of the data and methods into the single unit is known as encapsulation. Representation of an Object Data Abstraction and Encapsulation Classes behave like built-in data types of a programming language but are user-defined data types. For Example, apple, orange, and mango are the objects of the class Fruit. The collection of objects of similar types is termed as a class. Any number of objects can be created after a class is created. A class is a ‘data-type’ and an object as a ‘variable’ of that type. The entire set of code and data of an object can be made user-defined data type using the concept of the class. Objects can even interact without knowing the details of each other’s code or data. Each object contains code and data to manipulate the data. For Example, ‘customer’ and ‘account’ are two objects that may send a message to the account object requesting for the balance. The objects interact with each other by sending messages to one another when a program is executed. Any programming problem is analyzed based on objects and how they communicate amongst themselves. It may also represent user-defined data types like lists and vectors. An object can represent a person, a bank account, a place, a table of data. Objects are runtime entities in an object-oriented system.
0 Comments
Read More
Leave a Reply. |