Ivan Zhang’s Java Code: Input any amount of values. package newpackage; import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class Homeworkdevelopment { public static void main(String[] args) { @SuppressWarnings("resource") Scanner input = new Scanner(System.in); System.out.print("Please input a String: "); String userinput = input.nextLine(); if (userinput.equals("")) { System.out.println("Empty List"); System.exit(0); return; } char[] inputarray = userinput.toCharArray(); String[] inputstringarray = userinput.split(""); ArrayList numbers = new ArrayList(); ArrayList lettersup = new ArrayList(); ArrayList letterslow = new ArrayList(); ArrayList characters = new ArrayList(); for (int i = userinput.length(); i > 0; i--) { if ((int)inputarray[i-1] >= 48 && (int)inputarray[i-1] <= 57) { numbers.add(inputstringarray[i-1]); } else if ((int)inputarray[i-1] >= 65 && (int)inputarray[i-1] <= 90) { lettersup.add(inputstringarray[i-1]); } else if ((int)inputarray[i-1] >= 97 && (int)inputarray[i-1] <= 122) { letterslow.add(inputstringarray[i-1]); } else { characters.add(inputstringarray[i-1]); } } Collections.sort(numbers); Collections.sort(lettersup); Collections.sort(letterslow); Collections.sort(characters); StringBuilder changeletterslow = new StringBuilder(letterslow.toString()); StringBuilder newletterslow = changeletterslow.deleteCharAt(changeletterslow.length()-1); StringBuilder changelettersup = new StringBuilder(lettersup.toString()); StringBuilder newlettersup = changelettersup.deleteCharAt(0); System.out.println(numbers.toString()); System.out.println(newletterslow.toString() + ", " + newlettersup.toString()); System.out.println(characters.toString()); } }