Reading multiple integers from a single line or String and number from single line

I am stuck at figuring out, how to read String as well as as (multiple) numbers from a single line, for example

if I input an array, like:

99 88 77 66

How do I save this in my function defined array?

Also, if I am given input like

Bob 97
Alex 89
John 20

How do I read this using a scanner?

You need to create a separate class for Salary inputs and define a constructor to take input and compare function to remove redundant values.

just implement the comparable interface and write the compareTo method to sort according to given condition
https://ide.codingblocks.com/s/234889 you can take help of this code and understand the approach.