Describe even higer dimensions in java, JAVA Programming

Describe even higer dimensions in java?

You don't have to stop along with two dimensional arrays. Java allows arrays of three, four or more dimensions. Therefore chances are pretty good in which if you required more than three dimensions in an array, you're probably by using the wrong data structure. Still three dimensional arrays are exceptionally rare outside of scientific and engineering applications.

The syntax for three dimensional arrays is a direct extension of that for two-dimensional arrays. The program below declares, allocates and initializes a three-dimensional array. The array is filled along with the sum of its indexes.

class Fill3DArray {
   public static void main (String args[]) {
      int[][][] M;
    M = new int[4][5][3];
      for (int row=0; row < 4; row++) {
      for (int col=0; col < 5; col++) {
        for (int ver=0; ver < 3; ver++) {
          M[row][col][ver] = row+col+ver;
        }
      }
    }
      }
  }

You required the additional nested for loop to handle the extra dimension. The syntax for still higher dimensions is same. Just add another pair of brackets and another dimension.

Posted Date: 5/15/2013 3:30:30 AM | Location : United States







Related Discussions:- Describe even higer dimensions in java, Assignment Help, Ask Question on Describe even higer dimensions in java, Get Answer, Expert's Help, Describe even higer dimensions in java Discussions

Write discussion on Describe even higer dimensions in java
Your posts are moderated
Related Questions
Java has some bugs in its applets. Java team stated that they have zero tolerance over security features and subsequent editions of Java are managing Bug free environment. Some of

how to write coding for money and currency

Online music store that stores information about song, artist, album, customer, playlist. Also all necessary diagrams - use case, uml, erd

How can you define a readable program? A program that is easy to read & understand also easy to maintain and enhance. Readability is the ease in that text can be read and under

We need an OpenGL - based visualisation of an OBJ-File that was created out of Maya3D. (important: we have to use OpenGL with Java - JOGL) In other words: we have an OBJ-file (a


Give an example of Class or static Members? Below is a Car class along with such a speedLimit field and getSpeedLimit() method. public class Car { private String licensePla

What is an object's lock and which objects have locks? An object's lock is a mechanism that is used by multiple threads to get synchronized access to the object. A thread may i

hi i wanted to know if your tutors provide solutions for programming assignments

I want FitLIFE app for Android, IOS, Windows Project Description: Hello, I want to develop an app for Android, IOS and Windows Phone. This app will be work with open source B