Is it possible to convert or typecast a char array “gg[16][16]” to an object array “ff[16][16]”?
charToObject() and toObject() are both mostly used for single values.
Should this simply work:
Object[][] ff = (Object [][])(gg [16][16]);
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.
Since it’s a 2d array you need a nested for loop that look something like this:
assuming that gg is your original array, and ff is the new one. This will start by checking all “rows” in the first “column” of the array and assign that to the proper part of the new array, then continue looping thru the second “column” and assigning all “rows” that belongs to that column etc.