I have repeated values in my array such as Fiat, 2.3, 2006, Ford, 1.6, 2011
I’m trying to print out the values like:
Name: Fiat
Size: 2.3
Year: 2006
Name: Ford
Size: 1.6
Year: 2011
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
So you want to print out an Object array in the given format?
Please note that it would really be better to use an object to hold the data on each car, rather than keeping it all in a homogenous array. Something like:
Then to convert your Object array into a list of Cars,
This is assuming that you are using an Object array which contains Strings, Doubles, and Integers. If it is a String array,