Casting to an int implicitly drops any decimal. No need to call Math.floor() (assuming positive numbers)
Simply typecast with (int), e.g.:
System.out.println((int)(99.9999)); // Prints 99
This being said, it does have a different behavior from Math.floor
which rounds towards negative infinity (@Chris Wong)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…