Forums Register Login

using scanner class with multi-dimension

+Pie Number of slices to send: Send
please can anybody put me throuugh how to use the two dimension in scanner class
+Pie Number of slices to send: Send
The two dimension what?
+Pie Number of slices to send: Send
i mean multi-dimensional array
+Pie Number of slices to send: Send
Okay, multi-dimensional arrays. So what does the Scanner class have to do with them?

(And neither of them is really a Spring topic. Let's move the thread to Beginning Java.)
+Pie Number of slices to send: Send
am trying to create an application that will accept user inputs and store them inside two dimensional array
+Pie Number of slices to send: Send
 

accept user inputs and store them inside two dimensional array


If the 2 dim array contents are discussed as in rows and columns in each row, where do you want each item entered by the user to go?
For example: fill the columns on a row and move to the next row when all the columns on a row have values.
Or fill the first column for all the rows and move to the next column when all the rows are filled.
+Pie Number of slices to send: Send
 

Gbenga wale wrote:am trying to create an application that will accept user inputs and store them inside two dimensional array


OK, now we're getting somewhere...but we're still way short of a full explanation.

What are these inputs? Numbers? Text?

Is every "row" in your 2D array going to have the same number of columns?

Try to explain it to us as if you were explaining it to a smart child with no knowledge of Java:
What do they need to do?

There's more than one way to do this, but I suspect that, in explaining it to us, you'll probably work out how to do it yourself.

Winston
+Pie Number of slices to send: Send
sory for the late reply. It was due to power outtage in my area.
I thought I mentioned it that it is a dimensional array.
+Pie Number of slices to send: Send
OK, where should the user's input be placed in the array?
+Pie Number of slices to send: Send
inside a rectangular array..
Like a user will be asked to enter his firstname and lastname and username and password and it will be save inside an array. the rectangular array will be a size of 10 by 4. I.e. 10rows, 4columns.
+Pie Number of slices to send: Send
 

Like a user will be asked to enter his firstname and lastname and username and password


OK, I assume that would be an array of Strings.
What slot would be used for each item? For example 0,0 for firstname, 0,1 for lastname, etc.
If there is data for more than one person, where would the data go for each person? Would each person get his own row?

Use an assignment statement to put values into an array:
Time is the best teacher, but unfortunately, it kills all of its students - Robin Williams. tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 888 times.
Similar Threads
Sorting multi dimensional array
Problem with Incompatible Types. Help appreciated, information much more so.
Array
Array
defining arrays
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 07:55:26.