Hey guys! So I'm trying to create a method that takes in a list of integers into an array and prints the elements inside the array line by line. How do I print the the elements? Here's what I have so far:
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
}
public static int[] printElements(int num){
int[] array = new int[] {1,2,3,4,5};
for (int i = 0; i < array.length; i++){
System.out.print(array[i]);
}
System.out.println();
return array;
}
}