0

I need to store the matrix into a[][] from standard input. (System.in)

How do I initialize a if the size is unknown

Please help, thanks

user2735868
  • 83
  • 1
  • 1
  • 4
  • 2
    You can't. Use an `ArrayList` or `LinkedList`. Otherwise you will need to grow the array each time you need more space. – Sotirios Delimanolis Sep 25 '13 at 18:54
  • In addition to Sotirios suggestion: use `ArrayList`s or `LinkedList`s to receive the user input and, then, after everything was received, you will be able to instantiate the multidimensional array you want (a[][]), as you'll have its sizes. – fegemo Sep 25 '13 at 19:14

0 Answers0