Can a Array be ints and strings at the same time? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can a Array be ints and strings at the same time?

lol

24th Aug 2017, 4:24 PM
GodBlessAmericasFrog
GodBlessAmericasFrog - avatar
2 Answers
+ 6
An array must be of one data-type. Some solutions: * You can use an array of type Object OR * You can create your own class (like a struct) with a String and int as instance variables. Then make an array of the class.
24th Aug 2017, 4:31 PM
Rrestoring faith
Rrestoring faith - avatar
0
thank you!!!
24th Aug 2017, 4:32 PM
GodBlessAmericasFrog
GodBlessAmericasFrog - avatar