To be completely honest, I still don't understand too well about Object-Oriented Programming. But I will try my best to demonstrate what it is and its concepts.
I believe Object-Oriented programming is basically programming on objects. Objects represents both data type and the functions to interfere with the data type. For instance, when we design a class, we can design the data type of the class, as well as the set of methods to perform in the class.
It is considered an object because it has both data and a function, thus a complete object. For instance, we can create the object called 'book', which has data type of string, and takes methods such as 'write' or 'read'. After defining, 'book' will have both a type and a method, which allows it to be considered an object in nature.
We can also interact objects with other objects. Perhaps we can link our object 'book' with another object called 'novels'. In this case we can make our object inherit certain methods from the other object, which allows them to interact.
In my opinion, Classes and sub classes are most important elements of OOP. This is because they allow the programmers to actually create the object/module, and combine them to create a functioning program.
没有评论:
发表评论