java - How to multiply a double and an int and cast to int in single statment -
i'm trying accomplish following without luck
int = 1; double b = 0.5; int myinteger = (int) a*b;
you've declared b
integer.
try this:
int = 1; double b = 0.5d; int myinteger = a*b;
Comments
Post a Comment