what is the difference between object and class

Answer Posted / prema

Class is a template or a plan for creating objects.

For example: For construction of building we need a plan.
Without plan we can't construct building. Here plan acts as
class. Building acts as object.Using the same plan we can
build any number of building.

In the same way we can create any number of objects for the
same class.Class tell whats the object state and behaviour.
Basically class tells what the object should have.

Object is an real world entity, which has something and
which know something. It means ojects has state and
behaviour.State of the object is represented by instance
variable. Behaviours are representd by methods.

Is This Answer Correct ?    24 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

why are there separate wait and sleep methods? : Java thread

571


Can we declare an interface as final?

568


What is a generic data type?

569


What are the differences between stringbuffer and stringbuilder?

536


What is local variable and instance variable?

602






What is java in simple terms?

551


What is immutable class in java?

506


Explain the difference between an object-oriented programming language and object-based programming language?

543


What are the Main functions of Java?

623


What are different types of classloaders?

585


Define iterator and methods in iterator?

545


What does arrays sort do in java?

536


What is an arraylist in java?

513


Define inheritance with reference to java.

579


If a class is declared without any access modifiers, where may the class be accessed in java programming?

649