CAN YOU STORE MULTIPLE DATA TYPES IN SYSTEM.ARRAY?

Pushpendra Singh

Total Post:241

Points:1205
Posted by  Pushpendra Singh
C# 
C#
 1129  View(s)
Ratings:
Rate this:
  1. Pushpendra Singh

    Post:241

    Points:1205
    Can you store multiple data types in System.Array?

    No, You can not store multiple data types in System.Array.
    But if you have an object array then you can

  1. Pushpendra Singh

    Post:241

    Points:1205
    Can you store multiple data types in System.Array?

    If you take an array of object, you can store multiple data
    type in an array.
    object[] obj = new object[4];
    obj[0]=1;
    obj[1]="Neeraj";
    obj[2]=true;
    obj[3]=System.DateTime.Now;

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!