I used to know how to do it in C++... check tutorgig.com, devshed.com
and the Java documentation (search for "Java documentation" with
Google, it should be the first thing returned). Unless this is an
assignment for a class don't both with it, just use a binary search
(check tutorgig and devshed) because it's the fastest.