Java[034] – Vetores Multidimensionais

Vetores multidimensionais na linguagem Java.


package aulas;

public class Aula_34 {

public static void main(String[] args) {

double[][] x = {
 {10, 20, 30},
 {40, 50, 60},
 {70, 80, 90}
 };

 for(int i = 0; i < x.length; ++i){
 for(int j = 0; j < x[i].length; ++j){
 System.out.print(i + "|" + j + " = " + x[i][j] + "\t");
 }
 System.out.println("\n");
 }

 }
}

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