package test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
public class Test18 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String[] arr = new String[6];
ArrayList<String[]> list = new ArrayList<>();
int count = 0;
while (count<4) {
System.out.println("NEXT PEOPLE : ");
for (int i = 0; i < arr.length; i++) {
arr[i] = scanner.next().replace(",","");
}
String[] arr2 = arr.clone();
list.add(arr2);
count++;
}
for (String[] s : list) {
System.out.println(Arrays.toString(s));
}
System.out.println(arr[4]);
}
}
package test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
public class Test18 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String[] arr = new String[6];
ArrayList<String[]> list = new ArrayList<>();
int count = 0;
while (count<4) {
System.out.println("NEXT PEOPLE : ");
String cmd = scanner.next();
for (int i = 0; i < arr.length; i++) {
arr[i] = cmd.replace(",","");
}
String[] arr2 = arr.clone();
list.add(arr2);
count++;
}
for (String[] s : list) {
System.out.println(Arrays.toString(s));
}
System.out.println(arr[4]);
}
}