What I need to do is take a string that has random letters and take the letters and put them in alphabetical order. For example, lidfj, would be; dfijl.
What I am having trouble figuring out is how I should start the code. I know that I may need to use compare to, since I am not allowed to use arrays, but I'm not sure if that would be the best approach. And I'm not sure how I would start that either.
Thanks in advance.
Edit: I think I'm done for the night, since I can't seem to think of anything else.
public class PP426 {
public static String alphabetize (String input) {
String sorted = ";
for (int i = 0; i < input.length(); i++) {
char c = input.charAt(i);
if () {
sorted += character;
}
}
return sorted;
}
public static void main(String[] args) {
System.out.println(alphabetize("iunaselfksdf"));
}
}