passing array in jsp methods

by gowtham 2010-02-01 19:11:07



Passing Arrays In Jsp Methods







Passing Arrays In Jsp Methods

<%!
void Addition(int [] a)
{
for (int i = 0; i < a.length;i++) {
a[ i ] += 2;
}
}
%>

<%
int array[] = {2, 4 , 3, 6, 8};

out.println("Before the call to Addition...
");
for (int i = 0; i < array.length; i++) {
out.println("array[" + i + "] = " + array[i] + "
");
}
Addition(array);
out.println("After the call to Addition...
");
for (int i = 0; i < array.length; i++) {
out.println("array[" + i + "] = " +
array[i] + "
");
}
%>


Tagged in:

1327
like
0
dislike
0
mail
flag

You must LOGIN to add comments