int? d = 1; Type testType = d.GetType(); will result…

 Posted by Bhakti on 12/28/2009 | Category: C# Interview questions | Views: 14762
Select from following answers:
  1. System.Int64
  2. System.Int16
  3. System.Int32
  4. System.nullable<Int32>
  5. All Above

Show Correct Answer

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Raja on: 12/28/2009
Hi Bhakti,

It seems the answer selected by you is incorrect.

double? d = 1.0; 

Type testType = d.GetType();

Above code snippet gives "System.Double" result. Can you please review your question and answer again?

Thank you.
Posted by: Bhakti on: 12/28/2009
Hi Raja,
Thanks for bringing it to my notice.
I have updated question accordingly.
The main point i wanted to make clear with this question is, you can not identify nullable datatypes with GetType().(wchich i already have added in the justification).

Thanks once again.

Bhakti Shah

Login to post response