Greetings all,
I am new to the java programming language. I seem to have hit the wall when I try to sort words a user inputs.
I am trying to sort like four input words from the user and then alphabetise them...
I used the s.compareTo(t) method but the way I did it ended up being much longer then I tought... I must be overlooking something...( I compared each of the words to each other individually )
I am thinking that I could maybe use a loop with the if statement to help me sort with the compareTo method but I am stuck sigh :(.
Any help or pointers to the right dirrection on this would be much appreciated
I am new to the java programming language. I seem to have hit the wall when I try to sort words a user inputs.
I am trying to sort like four input words from the user and then alphabetise them...
I used the s.compareTo(t) method but the way I did it ended up being much longer then I tought... I must be overlooking something...( I compared each of the words to each other individually )
I am thinking that I could maybe use a loop with the if statement to help me sort with the compareTo method but I am stuck sigh :(.
Any help or pointers to the right dirrection on this would be much appreciated
Comment