types - Java- Identifying ints and doubles -
i want write conditional statement, depending on whether variable int or double, i.e
if (x double) stuff else if(x int) stuff else stuff
i know might not idea, choice now. possible?
i have no idea how x int or double without knowing @ compile time, but
void dostuff(int x) { stuff... } void dostuff(double x) { stuff... }
then
dostuff(x)
will call appropriate method.
Comments
Post a Comment