public static int random(int i,int j){
  return i + (int)(Math.random() * (j - i));
}

public static int random ( int i , int j ) { return i + ( int ) ( Math . random ( ) * ( j - i ) ) ; }
return a random integer between i ( inclusive ) and j ( exclusive ) .
