It will never be null. In the first pass, randNum will necessarily be 0 and will therefore equal numSoFar.