Java examples for Language Basics:double
Fractional part of a double is simply discarded when cast to an integer; it isn't rounded.
public class Main { public static void main(String[] args) { double price = 9.99; int iPrice = (int) price; System.out.println(iPrice);/*from w w w . j av a 2 s .c om*/ } }