Java Alphabetizing Strings

后端 未结 7 1252
悲哀的现实
悲哀的现实 2021-01-19 04:27

I have a project for class were I need to get 4 different strings inputted and then output them in alphabetical order.

So far I have this:

String wd1         


        
7条回答
  •  一向
    一向 (楼主)
    2021-01-19 05:00

    The easiest way to do what you are looking for is to put them in a list, then use list.sort() to put them in order.

提交回复
热议问题