Interviews20 answers
Is it possbile to store all DataType in Array ?
20 Answers
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.
Kshamesh AtnoorkarPosted Jan 5, 2017, 12:00 PM EST
yes
Manoj Kumar DuraisamyPosted Jan 2, 2017, 8:50 PM EST
YES
Gurmail MultaniPosted Dec 30, 2016, 6:39 AM EST
Yes, we can store by using array of Object Type.
Object type array can store any dataType
Jasbeer SinghPosted Dec 20, 2016, 1:18 AM EST
Yes
Shweta LodhaPosted Dec 5, 2016, 1:09 AM EST
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);
Ruby AmalaPosted Nov 21, 2016, 11:23 PM EST
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);
Ruby AmalaPosted Nov 21, 2016, 11:23 PM EST
yes
Hiren ParmarPosted Aug 13, 2016, 10:29 PM EDT
By using obect array it is possible.........I am sure try this.
Ashutosh PandeyPosted Jun 11, 2016, 3:41 AM EDT
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);
Ervis TrupjaPosted May 27, 2016, 7:06 AM EDT
int in = 2;
string st = "hai";
object[] obj = new object[2];
obj[0] = in;
obj[1] = st;
varaprasad mullapudiPosted May 10, 2016, 5:36 AM EDT
in arraylist you can store
Munesh SharmaPosted May 9, 2016, 8:45 AM EDT
array list can be used to store all data type in array
Keerthi VenkatesanPosted Apr 11, 2016, 5:37 AM EDT
ArrayList it is possible.
Sunil BabuPosted Apr 2, 2016, 3:24 AM EDT
Sorry ! You cannot store all things in an Array. Example : You cannot store any functions in an array.
Maruthi PalllamalliPosted Mar 9, 2016, 2:00 AM EST
Using Array of Object Type we can store any data type in object array
Pankaj Kumar ChoudharyPosted Feb 21, 2016, 3:16 PM EST
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
Vivek KumarPosted Feb 6, 2016, 10:11 PM EST
Yes, you can use object as the type for the array or list. Then any type can be stored in it.
Afzaal Ahmad ZeeshanPosted Jan 25, 2016, 6:15 AM EST
Yes, We can use var datatype
Ashish Kumar JaiswalPosted Jan 16, 2016, 1:57 AM EST
Yes, Its possible by create array with OBJECT datatype. All datatype inherited in .NET from System.Object namespace.
Manoj KallaPosted Jan 10, 2016, 9:57 PM EST















