129k views
5 votes
Write the definition of a method printarray, which has one parameter , an array of int s. the method does not return a value . the method prints out each element of the array , on a line by itself, in the order the elements appear in the array , and does not print anything else.

1 Answer

2 votes
void printArray(int a[ ]) {
int i; for (i = 0; i < a.length; i++){
System.out.print(a[i]);
System.out.println(); }
}
User Paal Pedersen
by
7.8k points