Displaying top two results in Java
<p>I need to display the top two results of my program, but not the number but the name of the person associated with it. <br> <br>
for example if I get tom=20 john=10 paul=0<br><br>
TOP 2:<br>
1. tom<br>
2. john<br><br>
or if I get a=20 b=0 c=0<br><br>
TOP 2<br>
1. tom<br>
2. no other score<br><br>
I was thinking of using an if-else statement but it gets really messy and long. Is there any other way i can do this easier? Any ideas please <br>
Thanks<br></p>

<pre><code>if (a &gt;= b) 
 if (a &gt;= c) { max= a; if (b &gt;= c) min= c; else min= b; }
 else { max= c; min= b; }
else if (b &gt;= c)
 { max= b; if (a &gt;= c) min= c; else min= a; }
else { max= c; if (a &gt;= b) min= b; else min= a; } 
</code></pre>

<p>this was kind of my idea. </p>
