5
Reply

Can you insert different datatypes in an array

Mukesh Kumar

Mukesh Kumar

7y
1.3k
1
Reply

    Yes , you can use ArrayList for this.for exampleArrayList arryList1 = new ArrayList(); arryList1.Add(1); arryList1.Add("Two"); arryList1.Add(3); arryList1.Add(4.5);

    yes you can with ArrayList

    You can use ArrayList to have array with multiple data types. This is deprecated though, you can use generic list List which uses less memory and stable.

    No

    yes by the use of object array object[] arr=new object[10];