- #1
kartikwat
- 49
- 0
What does object based programming mean?how does it localises the implementation details ,i tried to read it from book but i dint got it.
http://en.wikipedia.org/wiki/Object-oriented_programmingkartikwat said:What does object based programming mean?
adjacent said:
kartikwat said:What does object based programming mean?
kartikwat said:how does it localises the implementation details ,i tried to read it from book but i dint got it.
Filip Larsen said:In short, object-based programming is when you are being object-oriented in a language that not necessarily has no direct support of objects, i.e. mechanisms like encapsulation, inheritance, polymorphism and so on. In those languages you have to manually program these mechanisms in if you want them and the language has no native support for it. For instance, in Javascript you can use function instances to act as objects, and in C you can use structs and function pointers. Depending on the language it may not be an easy thing to do.
It strongly depends on the language in question, so your question can only be answered in very general terms. Do you have a specific language in mind? And which book are you referring to?
kartikwat said:I refer to sumita arora class 12 book.
kartikwat said:I refer to sumita arora class 12 book.
Filip Larsen said:In short, object-based programming is when you are being object-oriented in a language that not necessarily has no direct support of objects ...
It strongly depends on the language in question, so your question can only be answered in very general terms. Do you have a specific language in mind?
AlephZero said:The thread title says "Object based programming in C++".
kartikwat said:i can't get what it means.
jtbell said:Start at the top of the first page. Tell us where you first get "stuck."
Object-based programming in C++ is a programming paradigm that allows developers to create objects that have both data (attributes) and functions (methods). These objects can interact with one another, making it easier to write complex programs.
Object-based programming in C++ is a simpler version of object-oriented programming. In object-based programming, objects have attributes and methods, but they cannot inherit from other objects. In contrast, object-oriented programming allows objects to inherit from other objects, creating a hierarchy of classes.
To create an object in C++, you first need to define a class. A class is like a blueprint for an object, specifying its attributes and methods. Once you have a class, you can use the "new" keyword to create an instance of the class, also known as an object.
Object-based programming in C++ allows for code reusability, making it easier to maintain and update programs. It also allows for encapsulation, which means that the data and methods of an object are contained within the object, making it more secure. Additionally, object-based programming can make code more organized and easier to understand.
One example of object-based programming in C++ is creating a "Person" class with attributes such as name, age, and occupation, and methods such as "introduce" and "work." Then, you can create multiple instances of this class, each representing a different person with their own unique attributes and methods.