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 is polymorphism and abstraction?

611


What is the use of ‘finalize’?

621


What is composition? Explain the purpose of composition.

555


What are virtual functions, base class pointer, derived class pointer, biding references?

549


What are abstract functions? Why are they used?

566






How many methods are there in the externalizable interface?

563


What is method overriding?

557


Explain about parametric polymorphism?

620


Why is class hierarchies managed in object-oriented programming?

574


Do we require a parameter for constructors?

559


Can you create an instance of an interface?

595


Explain what is polymorphism?

616


Can you instantiate an abstract class and what is an inner class?

561


Do structs support inheritance?

537


What is the super keyword?

613