What is an Object and a Class in python? [duplicate] - conceptual

This question already has answers here:
What is the difference between objects and classes in Python
(5 answers)
Closed 3 years ago.
I came across the following line:
Every list object that you create in Python is actually an instance of List class.
What does Class and Object actually mean?
Another similar post
I saw the above post but in that they explain the difference between object and class. But what exactly is a class if Object is an instance of class.
Edit:
What is an instance?

Think of classes as blueprints for objects. So for example, you will only have one car model blueprint, and that is your class. Every single model that is produced is an instance. Hope it helps.

Related

Extending class in external library [duplicate]

This question already has answers here:
How to implement multiple inheritance in delphi?
(10 answers)
What are the pros and cons of using interfaces in Delphi?
(9 answers)
Closed 2 years ago.
I need to use an external library which has a class hierarchy, TC1 base, TC2 which derives from TC1, TC3A and TC3B which derive from TC2. I need to extend each class of this hierarchy with some attributes and methods, which will obviously need to be inherited from the derived classes. I don't want to change the library code. I can't use class helpers because I also have attributes to add. And Delphi doesn't support multiple inheritance. The use of encapsulation instead of inheritance seems to me not applicable in this case. How can I solve the problem?

How to point to a child class during runtime but not compile time? [duplicate]

This question already has answers here:
What exactly is a so called "Class Cluster" in Objective-C?
(5 answers)
Objective C - How can I create an interface?
(4 answers)
Closed 7 years ago.
Problem: Suppose I have a class (call it cA), which has a reference to a helper class (call it HelperBase). The Helper class can be extended for specific implementations (call those HelperA, HelperB, etc.). However, I don't want cA to have any knowledge of the specific implementations either HelperA, HelperB, etc; I just want cA to call whatever methods are in Helper. Is there a way to do that? Is there a term for this? I'm also not sure what the terminology is for this kind of design (if there is one).
Examples in objective-c would be greatly appreciated. Thanks!

Difference between subclass and category? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Difference between inheritance and Categories in Objective-c
What’s the difference and use of categories and inheritance?
thanks for your reply,for example we have nsstring class if we want to add methods to that class there is no need to create category for that,just we can subclass it but why we are using categories?Please help on this
Category adds some extra functionality to specific class (for example NSString). You don't need to declare the Object with that specific class name. You only import that category and all the Object implicitly become instance of the category, all the implementation is now available to them.
Where when subclassing, (sometimes you intently need to override the existing behavior/methods or you can add extra functionality too.) you explicitly declare that Object with the type like
MyCustomString *string;
and then all the methods become visible.

What is the difference between an object and instance? [duplicate]

This question already has answers here:
What is the difference between an Instance and an Object?
(25 answers)
Closed 1 year ago.
I just want to know what is the difference between an object and instance with example.
An object is a software bundle of related state and behavior. A class is a blueprint or prototype from which objects are created. An instance is a single and unique unit of a class.
read more :Class vs Object vs Instance
Often the words instance and object are synonyms. Read more about objects
Some languages (e.g. Smalltalk, Common Lisp, and even MELT) are reifying their classes, by having classes instances of meta-classes. In that case, you might say that these class objects are not instance (but it is a matter of terminology and context).
In other languages (e.g. C++) classes are not objects, e.g. because they make only sense at compile-time.
Some object oriented languages (e.g. JavaScript or Self) don't have classes but prototypes.
As has been already mentioned, a class is a blueprint/recipe for creating objects. Hence,
A class is a blueprint for creating objects of that class.
On the reverse side, an object is an instance of that class.
"Object" is a runtime concept, it exists while running. That is when, for example in Java,
when the program execution reaches a statement where is says
ClassA objA = new ClassA();
it is then that an object of that class is created, or instantiated. In the above code, objA is an instance of ClassA.

Main differences between Property's and Variables in VB.net [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Why use simple properties instead of fields in C#?
If I have a class, does it matter if I use a Variable instead of a Property? I mean, unless I need something to run during the get/set time period, does it really matter? It still gets the job done.
It doesn't necessarily "matter" which you do. The reason for using property get/set would be to validate values before they're assigned to the variable and ensure that it can't be directly accessed from outside the class.
If you only have a small application and your class won't be designed to be reusable, I don't see a problem with just using public variables.