Is class an Object? Is object a class?

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


Please Help Members By Posting Answers For Below Questions

How do you prevent a class from being inherited by another class?

775


what is virtual function and pure virtual function ?

734


Differentiate between a class and a method.

783


Explain about inheritance in oops?

726


What is the function of dynamic typing?

772


What's the benefit of using inheritance?

839


Does PowerShell support OOPs?

753


When will you use an interface and abstract class?

729


Explain what an object is.

786


What is diamond inheritance problem? How java 8 solves this problem?

840


Which OOPS concept exposes only the necessary information to the calling functions?

923


What's the main difference between arraylist / hashmap and vector / hashtable?

736


What is Abstract method and how different from Virtual Method?

681


Explain colloboration

696


What is the syntax of object oriented method call?

722