Hi :)
I remember there is a particular kind of thing in C++ called 'object' which is part of the family whose members are also structure and class. But I think the "Object" in the title "Object-Oriented Programming" isn't the same 'object' which is much closely related to structure and class. Rather the "Object" only implies the concept where different sections of the software are seen as different entities or objects. Perhaps, other more descriptive and suitable term would ve 'functional blocks'. What is your opinion on this? Please let me know. Thanks.
is "Object" in "OOP" the same 'object' which is closely related to class and structur
Started by jackson6612, Sep 18 2011 11:07 AM
8 replies to this topic
#1
Posted 18 September 2011 - 11:07 AM
I'm an outright beginner, learning C++. Using Win XP Pro and Code::Blocks. Be nice to me, please.:)
|
|
|
#2
Posted 18 September 2011 - 01:05 PM
In general programming an object normally refers to anything that can be modified, such as a variable or structure. In object oriented programming however it usually refers simply to the instance of a class, where the instance object has methods of its own and can freely interact with other portions of the program.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#3
Posted 18 September 2011 - 10:39 PM
Thank you, Alexander.
So, in plain words the "Object" in "OOP" refers to a self-sufficient distinct portion of a program. Please correct me if I'm wrong. Thanks.
Regards
Jackson
So, in plain words the "Object" in "OOP" refers to a self-sufficient distinct portion of a program. Please correct me if I'm wrong. Thanks.
Regards
Jackson
I'm an outright beginner, learning C++. Using Win XP Pro and Code::Blocks. Be nice to me, please.:)
#4
Posted 19 September 2011 - 12:25 AM
You can think of it as a generic term to describe data structures, of which can contain their own methods, data, or state. Languages of which implement objects often allow relationships between them, such as inheritance and polymorphism to name a few.
Alexander.
Alexander.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#5
Posted 19 September 2011 - 06:47 AM
Once again, thanks.
OOP is not a language rather it's a kind of functionality to organize the code effectively and efficiently. In C++ structure is also one way to organize things, then I believe comes class which is probably a more efficient than structure, and perhaps then comes object which is probably yet more efficient than class. Assuming what I said is correct, isn't there a yet more efficient way for organization than object? Please help me with it. Thank you.
Please note that I haven't read classes and object, and besides whatever C++ I knew some months ago is very rusty until now.
OOP is not a language rather it's a kind of functionality to organize the code effectively and efficiently. In C++ structure is also one way to organize things, then I believe comes class which is probably a more efficient than structure, and perhaps then comes object which is probably yet more efficient than class. Assuming what I said is correct, isn't there a yet more efficient way for organization than object? Please help me with it. Thank you.
Please note that I haven't read classes and object, and besides whatever C++ I knew some months ago is very rusty until now.
I'm an outright beginner, learning C++. Using Win XP Pro and Code::Blocks. Be nice to me, please.:)
#6
Posted 19 September 2011 - 11:20 AM
Discussing Classes and their objects we can take an example of blue prints. Imagine we have a blue print of a car that engineer have designed which contains all the functionalities of the car which is designed but can we drive the blue prints? Ofcourse not. We have to create a car using that blue prints and then we can drive it. Same as with the house blue prints. We can't sleep in blue print room or something else unless it is occured in reality. Same is the case here with Classes and objects. Classes are the blue prints and objects are their occurences. Simply object is the instance of the class. You may find the answer to your above post also.
Hope this helps!
Hope this helps!
I think i'm able to write a code for printing "Hello, World!". Proud of that!
#7
Posted 20 September 2011 - 03:38 AM
AKMafia001 said:
Discussing Classes and their objects we can take an example of blue prints. Imagine we have a blue print of a car that engineer have designed which contains all the functionalities of the car which is designed but can we drive the blue prints? Ofcourse not. We have to create a car using that blue prints and then we can drive it. Same as with the house blue prints. We can't sleep in blue print room or something else unless it is occured in reality. Same is the case here with Classes and objects. Classes are the blue prints and objects are their occurrences. Simply object is the instance of the class. You may find the answer to your above post also.
Hope this helps!
Hope this helps!
Thank you, AK. Your post was really helpful.
I'm little confused about the two bold terms above. Do you mean that class is a blueprint and object is 'realization' of that blueprint (at least in virtual world)? What do you mean by "instance"? Please let me know. Thanks.
Regards
Jackson
I'm an outright beginner, learning C++. Using Win XP Pro and Code::Blocks. Be nice to me, please.:)
#8
Posted 20 September 2011 - 03:54 AM
Yes, a class is just code (i.e. class { ...}) an object is the actual instantiation of the class, i.e. object foo, bar, baz where those three objects are separate from each other, yet are the same class.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#9
Posted 20 September 2011 - 04:11 AM
Thank you for clearing the confusion, Alexander.
Best wishes
Jackson
Best wishes
Jackson
I'm an outright beginner, learning C++. Using Win XP Pro and Code::Blocks. Be nice to me, please.:)
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









