Random generated pseudorandom numbers. The sequence depends on the random seed. 
Constructor Random() use the seed based on the current time: 
     public Random() { this(System.currentTimeMillis()); }
Two Random objects created within the same millisecond will have the same sequence of random numbers.In the for loop, the time interval for each iteration is so small. If the cpu is so fast, the interval may be less than one Milli-Second. That means Two Random objects have the same seed, so you get same random numbers.Test: 
1): 
you should see a different number after several same numbers. Depends on your CPU.for(int w=0;w<500;w++)
      cmp();2):
each Random object has different random seedfor(int w=0;w<5;w++){
  cmp();   
  try{
     Thread.sleep(50);
  } catch (InterruptedException e){}
}For this program, you have one Random object is enough. 
static Random rand = new Random();