Skip to content
Advertisement

Sort List of Strings arrays in Java

I’m trying to make a program that consists of an array of Strings . now I need to sort them in order ‘PJ’, ‘GHS’, ‘FJ’, ‘PAS’ and date.

input :

JavaScript

output:
//Always ‘PJ’, ‘GHS’, ‘FJ’ then ‘PAS’

JavaScript

Advertisement

Answer

You should consider using custom java classes instead of String Array. Find below an example to do it .

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement