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


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

What is an Object and Value?

Posted By: Dhilip.R     Posted Date: April 21, 2011    Points:5   Category :C#
Hi, Experts

what is an object?
what is a value?
what is the difference between object and value?

Thanks & regards
Dhilip.R

Responses
Author: Arul             
Posted Date: April 21, 2011     Points: 20   

Object is just an instance of a class. It has properties and behaviours.

Author: Dinkar             
Posted Date: April 22, 2011     Points: 20   

Object
The object type is an alias for Object in the .NET Framework. In the unified type system of C#, all types, predefined and user-defined, reference types and value types, inherit directly or indirectly from Object. You can assign values of any type to variables of type object. When a variable of a value type is converted to object, it is said to be boxed. When a variable of type object is converted to a value type, it is said to be unboxed. For more information, see Boxing and Unboxing.
following example see:
// keyword_object.cs
using System;
class SampleClass
{
public int i = 10;
}

class MainClass
{
static void Main()
{
object a;
a = 1; // an example of boxing
Console.WriteLine(a);
Console.WriteLine(a.GetType());
Console.WriteLine(a.ToString());

a = new SampleClass();
SampleClass classRef;
classRef = (SampleClass)a;
Console.WriteLine(classRef.i);
}
}


Author: kamlesh             
Posted Date: April 25, 2011     Points: 20   

Please Follow Link it will help ful

http://www.intap.net/~drw/cpp/cpp06_01.htm
http://www.objs.com/x3h7/cplus.htm
http://www.exforsys.com/tutorials/c-plus-plus/c-plus-plus-objects-and-classes.html
http://www.valuebasedmanagement.net/faq_what_is_value.html
http://www.albahari.com/valuevsreftypes.aspx
http://blogs.msdn.com/b/csharpfaq/archive/2010/01/25/what-is-the-difference-between-dynamic-and-object-keywords.aspx
http://en.wikipedia.org/wiki/Data_transfer_object

Thanks And Regards.
Kamlesh Nikam


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

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