Write a public static method named printArray, that takes two arguments. The first argument is an Array of int and the second argument is a String. The method should print out a list of the values in the array, each separated by the value of the second argument.

Respuesta :

Answer:

Written in Java

public static void printArray(int myarr[], String s){

       for(int i = 0; i<myarr.length;i++){

           System.out.print(myarr[i]+s);

       }

   }

Explanation:

This defines the static method alongside the array and the string variable

public static void printArray(int myarr[], String s){

The following iteration iterates through the elements of the array

       for(int i = 0; i<myarr.length;i++){

This line prints each element of the array followed by the string literal

           System.out.print(myarr[i]+s);

       }

   }

The method can be called from main using:

printArray(myarr,s);

Where myarr and s are local variables of the main

fichoh

The Java method defined prints the lists of values in the array supplied followed by the string value for each of the element in the array. The Java method goes thus ;

public static void printArray(int mylist[], String word){

for(int i = 0; i<mylist.length;i++){

System.out.print(mylist[i]+word);

}

}

#the static method named printArray is defined and holds the string and the array

#the for loop iterates for a given number of time based on the length of the array supplied

#for each iteration, it prints each value in the array supplies followed by the string declared.

Learn more :https://brainly.com/question/19504703