Create a multidimensional array in Java table format?

Asked

Viewed 150 times

0

I’m a beginner in Java and have doubts how to create Multidimensional Array, I have the table below

inserir a descrição da imagem aqui

How do I create a Multidimensional Array from this table?

  • all the houses of an array have to be of the same type, so building this information as a two-dimensional array is no big idea

  • I understood, but I need to find, the highest value of M1 by Origin as the example below. I do not know with arraylist would be easier than an Array. SP VIT R$ 300,00 BH CUR R$ 350,00 VIT CUR R$ 450,00

  • Both would not be good, since they share the same detail of all houses being of the same type. It would be better to represent with objects.

1 answer

1

Initializing the multidimensional array:

int[][] a = {
      {1, 2, 3}, 
      {4, 5, 6, 9}, 
      {7}, 
};

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.