Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to pass the columns of the 2D int array to a function

807600Nov 5 2007 — edited Nov 5 2007
Question/ Objective / Doubt:
problem in passing the columns of the 2D int array to a function

Program / code:
int value[][]=new int[9][9];
int temp1[]=new int [9];
int temp2[]=new int 9;

for(int i=0;i<9;i++)
{
	temp1=method(value[i]);
// temp2[i]=method(value[col]) //want to pass the columns one by one
}


//skeleton of the method
int method (int arr[])
{
//code
return i;
}




Description / Explanation:
I have a two dimensional int array value[ row][col ]
I want to pass this row & columns for a method which does some computations
I can pass the row but I couldn't do with the col.

My Try / My Effort:
method(value[ ] [ i ]) 
it gives error

I Think/ Hope / Guess:
i has to design another set up probably a method to pass there columns one by one
is there any other way to do ?

Jesh
Share knowledge; Grow together;

Edited by: java_jesh on Nov 6, 2007 1:21 AM

Edited by: java_jesh on Nov 6, 2007 1:23 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 3 2007
Added on Nov 5 2007
2 comments
288 views