.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Melody Anderson

Home >> Articles >> OOPS >> Post New Resource Bookmark and Share   

 Subscribe to Articles

What is an Object?

Posted By:Gurunatha Dogi       Posted Date: August 14, 2009    Points: 25    Category: OOPS    URL: http://www.dotnetspark.com  


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:

You can find source code at the bottom of this article.

 Subscribe to Articles


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend