answersLogoWhite

0


Best Answer

A class is an abstract idea. It's that "thing" you wrote the source code for.

An object is an instance of a class.

Example:

// Integer is the class; i is the instance of class Integer

Integer i;

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

15y ago

A class (public) holds objects and methods (actions that can be imported and used by other objects and classes. An object is a thing that holds behavior and attributes. For example, take the scientific group of Mammal. This would be a class. Dogs, cats, 60 Minutes cohost Morley Safer, and Wooly Mammoths are all objects inside the class Mammal.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

A class is basically a blueprint of an object (think of a class as blueprint for a house, and an object as a particular house). A class will tell you what components are necessary to make an object.



For example, a house class might say that each house object needs to specify how many floors it has, it must have a door, it must specify how many windows, it is a specific color, and it is able to be painted different colors.

A specific house object might be defined as having 2 floors and 5 windows, and it will definitely have a door. This house will be white, but can be painted different colors.


A class basically defines what properties and functions (or methods in Java) your objects will have. This way you know that when you create an object (which is based on the object's class), you know what properties it will have and what you can do with it.

So for the house example, if you want to make sure all houses can be painted different colors, you could specify a 'changecolors()' method in your house class. Then you know that you can use the changecolors() method on any house object, because it is defined in the house class.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

Objects are instances of classes. Like a template, a class defines the variables and methods that the object should contain. An object instantiated from a class is analogous to a house created from a blueprint.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

There is no such thing as object inheritance. An object is an instance of a class, it doesn't inherit from the class; the class simply defines the object's type. Classes, however, can inherit from other classes, creating new classes from existing classes. Derived classes inherit the combined public and protected members of their base classes, while the base classes retain control of their private members. Although it could be said that a derived object inherits the properties of its base class, that is not strictly true. The inheritance is gained via the class that defines the object, not by the object itself.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

Object:

Object is an entity that can be manipulated by the commands of a programming language such as values, variables , functions or data structure.

Class:

Class is a construct that is used as a blueprint to create a instance of itself - referred to as a objects.

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

Class

Defines the abstract characteristics of a thing (object), including the thing's characteristics (its attributes, fields or properties) and the thing's behaviors (the things it can do, or methods, operations or features). One might say that a class is a blueprint or factory that describes the nature of something. For example, the class Dog would consist of traits shared by all dogs, such as breed and fur color (characteristics), and the ability to bark and sit (behaviors). Classes provide modularity and structure in an object-oriented computer program. A class should typically be recognizable to a non-programmer familiar with the problem domain, meaning that the characteristics of the class should make sense in context. Also, the code for a class should be relatively self-contained (generally using encapsulation). Collectively, the properties and methods defined by a class are called members.

Object

A pattern (exemplar) of a class. The class of Dog defines all possible dogs by listing the characteristics and behaviors they can have; the object Lassie is one particular dog, with particular versions of the characteristics. A Dog has fur; Lassie has brown-and-white fur.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is Difference between class and object of a class?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What difference between package class and object?

A package is a grouping of similar classes. A class is a blue print for making an object. An object is, well, an object.


What is the difference between a class method and object in object-oriented C?

Class methods are the member functions that act upon member variables. An object is an instance of a class. C does not support object-oriented programming, but C++ does.


What is the difference between the class and the entity?

A class is a type. An entity is a object created from this type. A class is like a definition and the entity behaves as per this definition.


What's the difference between the Class 365 and Class 465 466?

The difference between the Class 365 and Class 465, 466 is basically the cost.


What is difference between classes and objects?

Posted by : Govind Singh Lodhithese are the following differences between java class and object.1. Class is a way of bind data member and method in single unit where as a object is a value form of a class or a instance of a class that means allocating sufficient amount of memory space.2. When we define a class ,there is no memory space allocated for data member of a class where as when we create a object of a class memory space is allocated for data members of a class.3.Class will have exist logically where as object will have exist physically.4.One class can have only one name where as corresponding one class we can create multiple object.5.Class load in main memory by using class loader subsystem where as after load class we can create multiple objects of a class.

Related questions

What difference between package class and object?

A package is a grouping of similar classes. A class is a blue print for making an object. An object is, well, an object.


What is difference between struct variable and class object?

structure variable can access the variable but class object can access the function also


What is the difference between a class method and object in object-oriented C?

Class methods are the member functions that act upon member variables. An object is an instance of a class. C does not support object-oriented programming, but C++ does.


What is the difference between classes and object in C?

An object is an INSTANCE of a class. Human is a class, while YOU are a person, an instance of Human class, but YOU do not represent the entire human class. Or, a class provides the abstraction, and an object is a typical example of that abstraction. Classes provide a blue print to build a real instance of an object.


What is the difference between the class and the entity?

A class is a type. An entity is a object created from this type. A class is like a definition and the entity behaves as per this definition.


Difference between class diagram and object diagram with necessary diagram and figure?

Class diagram represent generalized view of system while object diagram represent view of a system at a particular instant.


What is the difference between an object's speed and a object's velocity?

The difference between an object's speed and an object's velocity is that the object's speed is how fast it is going, and the object's velocity is how many units of speed the object has traveled.


What's the difference between the Class 365 and Class 465 466?

The difference between the Class 365 and Class 465, 466 is basically the cost.


What is the difference between a form file object and a windows form object?

difference between a form file and a form.


Difference between exclusive or inclusive class intervals?

difference between inclusive and exclusive class interval


What is the difference between force and tension?

[object Object]


difference between tripitaka and jataka?

[object Object]