Is class an Object? Is object a class?

Answer Posted / julian c

Stop thinking like programmers saying "Object is a class in Java, c# etc".

I have in front of me a number of Whiffleplops of different colours; black, blue and red.

The black, blue and red Whiffleplops are three different objects. They are also of different sizes and I can play with them.

Do you have a Whiffleplop with you? No? (Why not).

Do you see that Whiffleplop is a CLASS of object that I can define as having two attributes (colour and size) and behaviour (you can play with it)? When you do get a Whiffleplop of any size or colour then you'll have an object, or an instance of the Whiffleplop class. You don;t have to have one for me to define the class though!

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the basic concepts of oop?

720


What is the difference between data hiding and implementation?

744


Which OOPS concept is used as a reuse mechanism?

790


Differentiate between an abstract class and an interface?

722


What is a friend function?

748


What is the difference between a class and a structure?

686


Why is message passing between the objects important?

730


What is the difference between multiple and multilevel inheritance?

760


What does the keyword virtual represented in the method definition?

812


What is @functionalinterface?

746


Explain about inheritance in oops?

721


What is the use of interface?

756


Are constructors inherited? Can a subclass call the parent's class constructor? When?

742


Why are outlet connections required in object-oriented programming?

751


Can different parts of a partial class inherit from different interfaces?

732