0

Is there any way to store different types in the same array?

10th May 2016, 2:47 PM
Jamal Ergig
Jamal Ergig - avatar
7 Réponses
17th May 2016, 2:36 PM
James Flanders
+ 2
It could be done with an object oriented programming useing ArrayList. ArrayList<Object> listOfObjects = new ArrayList<Object>(); Code snippet is from Stackoverflow.
15th Jun 2016, 10:38 AM
Boris Atanasov
Boris Atanasov - avatar
+ 1
just trt arraylist as an object.ArrayList<Object>
4th Jul 2016, 10:37 AM
Ismail Khan
Ismail Khan - avatar
0
you could also use an array of Object.
13th Jun 2016, 3:07 PM
Timo Hocker
Timo Hocker - avatar
0
Just treat arraylist as an object.ArrayList<Object>
22nd Jun 2016, 5:38 PM
Muamer Mico Beginovic
Muamer Mico Beginovic - avatar
0
by using generics we can do that
22nd Jun 2016, 6:21 PM
Srikanth sreei
Srikanth sreei - avatar
0
we can use collection
27th Jul 2016, 8:30 PM
Raviraj tiwari
Raviraj tiwari - avatar