import java.util.Arrays;
public class Names2 {
public static void main(String[] args) {
while (!StdIn.isEmpty()){
String choice = StdIn.readString();
String[] myStrArray = new String[] {choice};
//SORTS STRING ARRAY INTO CASE & THEN ALPHABETICAL ORDER
Arrays.sort(myStrArray);
//for loop to print int values to console
for (int a = 0; a < myStrArray.length; a++) {
System.out.println(myStrArray[a]);}
}
}
}
The program does not seem to be working correctly. It does compile though. It's a problem with using the StdIn. When I ut just names there it works. How do I fix it so the StdIn works so the user can enter multiple names on there own. I am extremely beginner so please be simple and very specific. Thank you very much.