Here it goes,
static void main(String args[])
{
int [] numArray = {7,10,255,46,59};
int largest = numArray[0];
int smallest = numArray[0];
for (int i=1; i < numArray.length; i++)
{
if(numArray[i] > largest)
{
largest = numArray[i];
}
if(numArray[i] < smallest)
{
smallest = numArray[i];
}
}
}
rahul@javareference.com
--------------------------
http://www.javareference.com