posted 20 years ago
You can't call methods on primitive types like double, or int, float, long, short, byte, char, or boolean. You might be confusing double with java.lang.Double, which is a a class which does indeed have an intValue() method. But a double is not a Double.
Anyway, if you have a value of type double and you need a value of type int, you can use a cast:
Note that fractions will be truncated towards zero; if your double is between 0 and 1, then casting it to an int will give you 0.