You can turn any object from one compatible type to another by using 'type-casting'. You use this syntax:
double i = 2.0;
int i2 = (int) i;
Notice how I just put (int) before the variable i? This basically says 'hey, try to make i an int, if you can'. Since java can easily convert a float to an int, it will.