0
Is there any way to store different types in the same array?
7 Answers
+ 2
You can use an ArrayList for that. Check this: http://stackoverflow.com/questions/18624885/how-to-store-multiple-datatypes-in-an-array
+ 2
It could be done with an object oriented programming useing ArrayList.
ArrayList<Object> listOfObjects = new ArrayList<Object>();
Code snippet is from Stackoverflow.
+ 1
just trt arraylist as an
object.ArrayList<Object>
0
you could also use an array of Object.
0
Just treat arraylist as an object.ArrayList<Object>
0
by using generics we can do that
0
we can use collection