hi, i just want to get some opinions on a queues homework project. i haven't written any code yet, but just want to know if it is possible to create an array[16] items and then that each item has an array[1][3], i have to work independently with each item of the first array (array[16]), so i don't know if it will be best to create an array[16][1][3] or create the array[16] that contains 16 array[1][3], thank
uonsin
-2
Newbie Poster
Recommended Answers
Jump to PostYou can do either, but initialising a 3D array in one go can be a little daunting, depending on what your putting in.
You could just initialise all your double arrays, then do...
String[][][] array=new String[][][]{
doubleArray1,doubleArray2,doubleArray3, etc,...}Hope that helps
Jump to Postarray[16][1][3] is of no practical use. Why nest the third level under a second level that only contains a single item? You are just making more work for yourself and creating potential problems by doing that.
All 5 Replies
cms271828
2
Junior Poster
uonsin
-2
Newbie Poster
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
uonsin
-2
Newbie Poster
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.