A suggestion on making your code more readable: use a final variable instead of a literal for the indexes.
Instead of arr[i][0] use arr[i][WrkrNbrIdx] & arr[i][WrkrNameIdx]
with these definitions;
final int WrkrNbrIdx = 0;
final int WrkrNameIdx = 1;
|
Quote:
|
|
System.out.println(arr[i][1]+" "+arr[i][0]+" "+arr[j][0]);
|
With the above println() statement there is no way to get:
|
Quote:
|
|
worker id 2871882 36963 027634 964956
|
I think you need to state what the assignment is more clearly. Looking at you second post, it looks like you want to find all the different worker ids and for each one, output the numbers associated with it.
For this you'll need a way to remember all the unique worker ids, say a Map as Nicholas suggests, using the worker id as the key and storing the numbers as the value associated with the key. So you'll need to think of an class that can store the numbers.