Yes, using a dynamic or object type array
Interviews12 answers
Is it possible to store mixed datatypes such as int, string, float, char, all in one array?
12 Answers
Munib ButtPosted Apr 28, 2020, 9:36 AM EDT
dynamic[] arr = { “abc”, 11, 11.23, true };
Console.WriteLine(arr[0] + “ “ + arr[1] + “ “ + arr[2] + “ “ + arr[3]);
ArrayList dynamicArray = new ArrayList(4);dynamicArray.Add("abc");dynamicArray.Add(11);dynamicArray.Add(12.34);dynamicArray.Add(true);Console.WriteLine(dynamicArray[0] + " " + dynamicArray[1] + " " + dynamicArray[2] + " " + dynamicArray[3]);
Rajiv RanjanPosted Apr 24, 2020, 7:17 PM EDT
yes,we can declare the array as an object type
example :-
object[] ar = { 22, ‘h’, “All” };
pradeep kumarPosted Feb 17, 2020, 1:36 PM EST
Yes , we need to create array as an object type or we need to create aarayList.
Saurabh VasaniPosted Aug 8, 2019, 9:07 PM EDT
No,Because array is a collection of similar dataitems
RanjithKanna MPosted Jun 5, 2019, 7:42 AM EDT
Yes,By Using Array List
kajal ranePosted Apr 7, 2019, 12:36 AM EDT
yes we can achieve through Dynamic array.
siva bPosted Mar 12, 2019, 8:02 AM EDT
Yes, We can create dynamic array and it is also possible with object array
Vikas AgarwalPosted Nov 20, 2018, 2:29 AM EST
we can use dynamic array ex- dynamic[] arr = {"abc",11,11.23 };
bibekananda panigrahiPosted Nov 20, 2018, 12:55 AM EST
yes it is possible for that you need take array as object type.
Naveen BishtPosted Nov 19, 2018, 1:19 AM EST
We can do that but , Array List is the correct .
Rashmiranjan DalabeheraPosted Nov 15, 2018, 12:31 AM EST
It can be achieved using array of object.
Sunil JoshiPosted Nov 13, 2018, 11:05 PM EST






