[Solved] Reversing a strings in an array of string[] [closed]


But is there any built in functions to do that?

There is.

But before I give you the answer, I just want to point out that it should be a trivial matter to write code to reverse an array for yourself.

If it is not trivial for you, then you obviously need more practice … and that means writing the code yourself.


OK. Here is the answer:

String[] strings = ...
Collections.reverse(Arrays.asList(strings));

Now if you are a good student, you will now lookup the javadocs, read them carefully, and work out what that code is doing and why it works.

1

solved Reversing a strings in an array of string[] [closed]