Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Array required but object found?

807597May 6 2005 — edited May 6 2005
Hi I'm try to print out an element of a multidimensional array which is also an array! I have Object array records[400] each element of this array is another object array containing 4 strings and a string array
I have no problem printing the four strings:
for(int y =0; y < 4; y++){
System.out.println(((Object[])Records[0])[y]);
}
However I cannot print the fifth element of the array which is the array. Here is my code:
for(int z = 0; z < Records[0][4].length; z++){
System.out.println(((Object[])Records[0])[4]);
}
I get an error saying array required but java.lang.object found!
Can someone please help I'm completely confused have been messing with it all day! Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 3 2005
Added on May 6 2005
3 comments
3,399 views