I don't think there is need for type casting here. random.nextInt(100) returns int.