Loading
Publish On: 2019-03-22

Guy white

Total Post: 819

Question: What are objects in programming

Reply On: 2013-10-20

Computer Science

Total Post: 1

ANS: What are objects in programming

Everything in the real world is made up of objects. An object is an entity which has certain characteristics.

For example: an apple is an object with certain characteristics such as color, shape, taste etc.

A box is an object with charctersistitics has a value. In the example of the apple, the charctersistitics color may have the value ‘red’, shape ‘round’ and taste ‘sweet’.

When you have two apples, they are both objects that belong to the same object type ‘Apple’. This we understand because they have the same characteristics.

But one apple is still a different object from another apple. Each needs its own space to exist. Their characteristics an also have different values. For example, One apple might taste sweet but the other might be sour-sweet.

Similarly in the world of object oriented programming, every program is an object. For example: you may define a program called “Apple”. You can then create many objects of type Apple. These objects will have all the characteristics of the program Apple. However each object of type “Apple” will have its own unique identity. This identity is provided by java by allocating a separate memory location to each object.

 

Submit Your Answer

warning: Please Login To Submit Your Answer
Like Us On Facebook for All Latest Updates