What is an Object?

Posted by in OOPS category on for Beginner level | Views : 8861 red flag
Rating: 5 out of 5  
 2 vote(s)

This article will discuss about objects in programming.

 Download source code for What is an Object?


This article will discuss about objects in programming.Watch our 500 videos on Azure, WCF, WPF, LINQ, Design Patterns, WWF, Silverlight, UML @ http://www.questpond.com

What is an object?

  • An object is a software bundle of variables and related methods.
  • Objects are related to real life scenario
  • Class is the general thing and object is the specialization of general thing
  • Objects are instance of classes.
  • Declaration of an Object in C#.NET
  • ClassName objectName=new ClassName();
  • E.g.: Person objPerson= new Person();

An object is characterized by concepts like:

  • Attribute
  • Behavior
  • Identity

1. What is an Attribute?

  • Attributes define the characteristics of a class.
  • The set of values of an attribute of a particular object is called its state.
  • In Class Program attribute can be a string or it can be a integer

Example of Attribute:


2. What is a Behavior?

  • Every object has behavior
  • In C#, behaviors of objects are written in methods.
  • If a behavior of an object needs to be performed, then the corresponding method is called.

Example of Behavior:

3. What is an Identity?

  • Each time an object is created the object identity is been defined.
  • This identity is usually created using an identifier which is derived from the type of item

Example of Identity:

The source code is attached at the top of this article.

Page copy protected against web site content infringement by Copyscape

About the Author

Full Name: Gurunatha Dogi
Member Level: Starter
Member Status: Member
Member Since: 8/13/2009 12:50:13 AM
Country: India
Gurunatha Dogi
Gurunatha Dogi, is a software engineer by education and profession. He likes c#, java, php, , asp.net, sql server and seo optimization. During free time he likes to write blogs on various technical topics and tips and tricks on search engine optimization. He likes to play guitar and cricket. Currently he is working in @Questpond one well known of e-learning firm in India.

Login to vote for this post.

Comments or Responses

Posted by: Hareesh on: 3/8/2012 | Points: 25
hi gurunath
you explain very clear with proper screen shots.


Login to post response

Comment using Facebook(Author doesn't get notification)