Answer Posted / murthy
A class is neither an object nor an object is a class.
A class is like a blue print for an object.
An object is an instance of a class.
Some people have given the right examples above and some
more goes here:
You can consider a blue print for your house is a class.
You cannot stay in blue print :).
The building built based on the blue print is called an
object. You can stay in it.
Class should be treated like a "data type" and an object
like a instance of that datatype.
for e.g., int i; you can considet int as a class and i as
an instance of an object.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Explain what is an object?
Explain the meaning of object in object oriented programming?
What are virtual functions, base class pointer, derived class pointer, biding references?
If a class inherits an interface, what are the 2 options available for that class?
Can a function be overloaded based on return types?
What is data abstraction? what are the three levels of data abstraction with Example?
What are the types of polymorphism?
How many methods are there in the externalizable interface?
What is the difference between class and interface?
Do structs support inheritance?
Can an interface contain fields?
What is a nested interface?
What is the significance of encapsulation?
What are the four important foundation concepts of OOP ?
Can you give some examples of tokens?