What is Object and Class? What are the differences between
them?

Answers were Sorted based on User's Feedback



What is Object and Class? What are the differences between them?..

Answer / jack

simple analogy for this quest is u declare int x;
and u ask diff between int and x;


Object is an instance of a class.......
--when an object of a class is created the memory for
that class is created...
--U can access the class members using the . operator in
your program....but u r not allowed to access the private
and protected members, which can be accessed by the member
functions only........

Class is the user defined datatype...which contains data
members and member functions.....

Is This Answer Correct ?    8 Yes 0 No

What is Object and Class? What are the differences between them?..

Answer / pankaj vashishta

Class is template for creating similar type of entities.
Class doesn't take memory space untill it contains static
members.
In a specific Class, you declare the attributes(field
variables) and its behaviour(functions).
But Class doesn't have any state and identity.

Objects are the real time entity which are created through
their template, thier class.
By real time entity, I mean they would occupy a memory
space in which they will save the values of its atrributes.
These values create a state of an object.
Since Object occupy a space in memory so they have unique
address in memory. This become the identity of an object.

For example : Pen is a class, which has weight and color as
its attribute. They may have behaviour like write().

Still they don't occupy a space in memory.

When I say My pen ,It will be an object of class Pen since
it will have some values for weight like 10 gm and color
like blue. This will occupy some memory to save these
values.

Is This Answer Correct ?    4 Yes 0 No

What is Object and Class? What are the differences between them?..

Answer / kalaivani

object-run time entity
class- bind of function & data

Is This Answer Correct ?    3 Yes 1 No

What is Object and Class? What are the differences between them?..

Answer / prabhakar

class is a collection of data and member functions.
objcet is instance of a class

Is This Answer Correct ?    1 Yes 1 No

What is Object and Class? What are the differences between them?..

Answer / poorna chandar rao

Object and Class both are same there is no difference
bettwen them those are having properties(data) and methods
but small difference beteween them that is objects are
available physically avialable and class is not avialable
class is a bluprint

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More OOPS Interview Questions

What is a template?

7 Answers  


How is data security provided in Object Oriented languages? ?

5 Answers  


Have you ever used threads?

3 Answers   Adobe, IBM,


Name an advantage of array over linked list?

24 Answers   GML, IBM, Software Solutions,


This program numbers the lines found in a text file. Write a program that reads text from a file and outputs each line preceded by a line number. Print the line number right-adjusted in a field of 3 spaces. Follow the line number with a colon, then one space, then the text of the line. You should get a character at a time and write code to ignore leading blanks on each line. You may assume that the lines are short enough to fit within a line on the screen. Otherwise, allow default printer or screen output behavior if the line is too long (i.e., wrap or truncate). A somewhat harder version determines the number of spaces needed in the field for the line numbers by counting lines before processing the lines of the file. This version of the program should insert a new line after the last complete word that will fit within a 72-character line.

0 Answers  






What is destructor example?

0 Answers  


Difference between over loading and over ridding?

12 Answers   CTS, Patni, Softvision Solution,


Should you protect the global data in threads? Why or why not?

2 Answers   IBM,


difference between static and non-static variables?

2 Answers  


What does and I oop mean in text?

0 Answers  


What are the types of abstraction?

0 Answers  


What is function overloading and operator overloading?

4 Answers  


Categories