What does this program print?

package hack;

import java.util.Random;

public class JDKRandomThreatOrMenace {
        
        public static void main(String[] args) {
                Random rnd = new Random(0);
                
                double last = rnd.nextDouble();
                long i = 1;
                for(; i < Long.MAX_VALUE; i++) {
                        rnd.setSeed(i);
                        double next = rnd.nextDouble();
                        if (Math.abs(next - last) > 0.2) 
                                break;
                }
                System.out.println(i);
        }

}

Your prize if you get it right? A patch would be welcome...

Reply via email to