Java #39: How to Create a Multi-Dimensional Array in Java

//Programmer: Akinwale Owi
//Company: Dagba Computers
//Program Purpose:Create and Print From a Multi Dimensional Array

package dagbacomputers;

/**
*
* @author Akin
*/

public class DagbaComputers {

/**
* @param args the command line arguments
*/
public static void main(String[] args)
{
//Creating the multi dimensional array
int[][]triArray = { {4, 39, 50, 111111},
{5000, 444, 29999, 2},
{28, 888888, 7, 55}}; // end of array

//Printing out one value from the first line
System.out.println(“A First Line Value: ” + triArray[0][1]);

//Printing out one value from the second line
System.out.println(“A Second Line Value:” + triArray[1][2]);

//Printing out one value from the third line
System.out.println(“A Third Line Value:” + triArray[2][0]);

}//end of main
}//End of DagbaComputers Class

————End of Program———-
————Output————–

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: