How can I convert a double to an int? I'm trying to use the
method, but I don't know how. I've tried all the ways I can think of, but they don't work:
gives the error "non-static method intValue() cannot be referenced from a static context."
gives the error "double value cannot be dereferenced."
Finally,
gives the error "cannot find symbol - method intValue(double)".
I know, in all likelihood, I've missed something very obvious and I'll kick myself when someone points it out. But I'll just be happy if I can get it to work.
Thanks in advance.
Code:
Double.intValue()
Code:
int x = Double.intValue();
Code:
int x = arrayDoubleVal.Double.intValue();
Finally,
Code:
int x = Double.intValue(arrayDoubleVal);
I know, in all likelihood, I've missed something very obvious and I'll kick myself when someone points it out. But I'll just be happy if I can get it to work.
Thanks in advance.