Shouldn't you seed your largest and smallest like this?

int largest = Integer.MIN_VALUE;
int smallest = Integer.MAX_VALUE;
Then after reading the first value you set them both to the input...