Test case not passed

sir according to mycode output is coming correct but test case is not passed.then how can i come to know that which test case is not passed

Please share your code so I can help you find your mistake

The part where you are checking if the salaries are equal, you are doing it after sorting the arrays. But you need to do it inside the sorting algorithm itself. So, in your sorting algo, you already have a condition to check if arr[j]>arr[j+1], put an else if condition to check if arr[j]==arr[j+1], and if that is true then swap the corresponding strings there only.

else if (arr[j]==arr[j+1]){
int val=str[j].compareTo(str[j+1]);
if(val>0){

           String temp2=str[j];
           str[j]=str[j+1];
           str[j+1]=temp2;
       }

In general, the time complexity of bubble sort is really high, so for large test cases this solution will give you TLE. It is better to use the inbuilt sorting algorithms which work in O(nlogn) time. But you will have to use the concept of classes and write your own comparator function to use the inbuilt algo.

please see the above commented code.it is showing mismatch exception error

Did you put input in the input box? If you don’t give any sample input then you will get input mismatch exception error

it is showing same error even after giving input

also tell whether now code if correct or not

I tried your code on hackerblocks, and it is not showing any such error. Are you sure you provided correct input and imported the Scanner class?
There is one mistake in your code, you have put the final for loop in which you are printing your answer, inside the first for loop of your sorting algorithm. The printing for loop should be outside both the previous for loops. And one of the test cases will not pass using your code, because of the time constraints I mentioned before.