Sandeep Soni
Is it possible to store mixed datatypes such as int, string, float, char, all in one array?
By Sandeep Soni in C# on Oct 29 2018
  • bibekananda panigrahi
    Nov, 2018 20

    we can use dynamic array ex- dynamic[] arr = {"abc",11,11.23 };

    • 2
  • Naveen Bisht
    Nov, 2018 19

    yes it is possible for that you need take array as object type.

    • 2
  • Rashmiranjan Dalabehera
    Nov, 2018 15

    We can do that but , Array List is the correct .

    • 2
  • Vikas Agarwal
    Nov, 2018 20

    Yes, We can create dynamic array and it is also possible with object array

    • 1
  • sunil joshi
    Nov, 2018 14

    It can be achieved using array of object.

    • 1
  • Munib Butt
    Apr, 2020 28

    Yes, using a dynamic or object type array

    • 0
  • Rajiv Ranjan
    Apr, 2020 24

    dynamic[] arr = { “abc”, 11, 11.23, true };
    Console.WriteLine(arr[0] + “ “ + arr[1] + “ “ + arr[2] + “ “ + arr[3]);

    1. ArrayList dynamicArray = new ArrayList(4);
    2. dynamicArray.Add("abc");
    3. dynamicArray.Add(11);
    4. dynamicArray.Add(12.34);
    5. dynamicArray.Add(true);
    6. Console.WriteLine(dynamicArray[0] + " " + dynamicArray[1] + " " + dynamicArray[2] + " " + dynamicArray[3]);

    • 0
  • pradeep kumar
    Feb, 2020 17

    yes,we can declare the array as an object type
    example :-
    object[] ar = { 22, ‘h’, “All” };

    • 0
  • Saurabh Vasani
    Aug, 2019 9

    Yes , we need to create array as an object type or we need to create aarayList.

    • 0
  • RanjithKanna M
    Jun, 2019 5

    No,Because array is a collection of similar dataitems

    • 0
  • kajal rane
    Apr, 2019 7

    Yes,By Using Array List

    • 0
  • siva b
    Mar, 2019 12

    yes we can achieve through Dynamic array.

    • 0

Most Popular Job Functions


MOST LIKED QUESTIONS