I got the following code:
object var3 = 3;
Console.WriteLine(var3.GetType().ToString());
Console.WriteLine(typeof(object).ToString());
The output is:
System.Int32
System.Object
Why aren’t they both System.Object?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you’re asking why the boxedObject.GetType() does not return Object.. check out the image under the Section ‘Boxing Conversion’ on the MSDN Boxing and Unboxing page. Good question btw.. atleast my understanding of your question.
Although I may not be technically correct, it looks like