public class Lab6 {
public static void main(String[] args) {
int List1[] = new int[10];
List1[0] = 1;
List1[1] = 3;
List1[2] = 4;
List1[3] = 5;
List1[4] = 2;
List1[5] = 6;
List1[6] = 8;
List1[7] = 9;
List1[8] = 2;
List1[9] = 7;
toDisplay(List1);
}
public static void toDisplay (List1){
int i;
for(i=0; i>10; i++){
System.out.print(List[i] + " ");
}
}
}
It will not carry over and recognize my List1 array. How do I display the List1 array in another method without making it a global?
main(String[] args) {.int[] list = {1, 3, 4, 5, 2, 6, 8, 9, 2, 7 };