Https://ide.codingblocks.com/s/122731

i am not getting all values
also is this correct way to find first 2 largest numbers and print them or is ther any short way

You are able to correctly print the order of each triplet, but all the answers are not sorted among themselves. For doing that, all you need to do, is pass a sorted array to your function. That is, after taking input of your array, apply Arrays.sort(arr) and then pass this sorted array to your function. This will automatically ensure that all your answers are sorted among themselves.
Also, for each triplet also you can keep a temporary array of size 3 and add all elements to it and then sort it and print, instead of putting so many if-else conditions.

I hope this clears your doubt, if there’s anything you didn’t understand then let me know!

showing index out of bounds

  1. You have removed the if-else loops, but you have not sorted the triplet elements among themselves. Note that in this question, the answers are sorted twice/in two ways - a) All the different possible triplets are sorted and b) All elements of a particular triplet are sorted among themselves.
    You need to ensure that both these are covered by your code. And you have used parallel sort, I am not familiar with it, but the normal sorting function is Arrays.sort(arr)

  2. Check you for loops. If j starts from i+1, then the condition on i should not be i<arr.length, you will only go till arr.length-3, similarly k starts from j+1, so check condition for j. That is why you are getting out of bound error.

i am unable to understand what you are saying

Refer to this corrected code so that you are able to understand what I am saying, and if anything is not clear then let me know.