Manoj Kalla
Is it possbile to store all DataType in Array ?
By Manoj Kalla in C# on Jan 09 2016
  • Ervis Trupja
    May, 2016 27

    Yes, it is possible. For this you have to create an array of Object Type. Example: Object[] myObjects = Object[2]; myObject.Add(2); myObject.Add("String"); myObject.Add(true);

    • 1
  • Pankaj  Kumar Choudhary
    Feb, 2016 21

    Using Array of Object Type we can store any data type in object array

    • 1
  • Manoj Kalla
    Jan, 2016 11

    Yes, Its possible by create array with OBJECT datatype. All datatype inherited in .NET from System.Object namespace.

    • 1
  • Kshamesh Atnoorkar
    Jan, 2017 5

    You can use ArrayList to store any type of data in the Array, however, I have never seen a requirement to create this array. You should avoid using ArrayList as it comes with the cost of performance which uses boxing/unboxing internally and that's how Microsoft introduced Generics.

    • 0
  • Manoj Kumar Duraisamy
    Jan, 2017 3

    yes

    • 0
  • Gurmail Multani
    Dec, 2016 30

    YES

    • 0
  • Jasbeer Singh
    Dec, 2016 20

    Yes, we can store by using array of Object Type. Object type array can store any dataType

    • 0
  • Shweta Lodha
    Dec, 2016 5

    Yes

    • 0
  • Ruby Amala
    Nov, 2016 22

    through the arraylist it is possible.//creation of ArrayList ArrayList array = new ArrayList(); //Add method for adding values in ArrayList array.Add(1); array.Add("string"); customer c = new customer(); c.ID = 1; c.Name = "C# corner"; array.Add(c);

    • 0
  • Ruby Amala
    Nov, 2016 22

    through the arraylist it is possible.//creation of ArrayList ArrayList array = new ArrayList(); //Add method for adding values in ArrayList array.Add(1); array.Add("string"); customer c = new customer(); c.ID = 1; c.Name = "C# corner"; array.Add(c);

    • 0
  • Hiren Parmar
    Aug, 2016 14

    yes

    • 0
  • Ashutosh Pandey
    Jun, 2016 11

    By using obect array it is possible.........I am sure try this.

    • 0
  • varaprasad mullapudi
    May, 2016 10

    int in = 2; string st = "hai"; object[] obj = new object[2]; obj[0] = in; obj[1] = st;

    • 0
  • Munesh Sharma
    May, 2016 9

    in arraylist you can store

    • 0
  • Keerthi Venkatesan
    Apr, 2016 11

    array list can be used to store all data type in array

    • 0
  • Sunil Babu
    Apr, 2016 2

    ArrayList it is possible.

    • 0
  • Maruthi Palllamalli
    Mar, 2016 9

    Sorry ! You cannot store all things in an Array. Example : You cannot store any functions in an array.

    • 0
  • Vivek Kumar
    Feb, 2016 7

    The Object Type is the ultimate base class for all data types in C# Common Type System (CTS). Object is an alias for System.Object class. So we can create object data type for storing all DataType in Array

    • 0
  • Afzaal Ahmad Zeeshan
    Jan, 2016 25

    Yes, you can use object as the type for the array or list. Then any type can be stored in it.

    • 0
  • Ashish Kumar Jaiswal
    Jan, 2016 16

    Yes, We can use var datatype

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS