I have this output and I want to determine the computer with largest price
Name Capacity Price
----- ------- -----
Computer 1 Dell 170 292.30
Computer 2 HP 94 452.30
Computer 3 Compaq 167 933.30
Computer 4 Toshiba 162 1171.30
Computer 5 Dell 189 1550.30
Computer 6 HP 53 2027.30
Computer 7 Apple 29 2288.30
Computer 8 Dell 48 2542.30
Computer 9 Dell 128 2700.30
Computer 10 Lenovo 171 2828.30
the computer with max price is :
Lenovo 171 2828.30
I got the code, but it print the whole line, I only want the name of that computer here is the code
System.out.println("the computer with max price is :");
SortByPrice(list);
int k = list.length;
list[k-1].printComputer();
I am thinking like having the first index of that line as the name of the computer