By casting (but note that this may not yield the results you want)...
class Test {
public static void main(String[] argv) {
double a = 5.5;
double b = 6.6;
int c = (int)(a + b);
System.out.println(c);
}
}
> Could you please elaborately explain your statement.
> I am basically trying to understand the concept. What
> does valueOf(double y)do and why String class and why
> pasrInt()... please explain elaborately if you could
> thats great !! thanx
@flounder: Now look at what you've gone and done to this poor guy ...
<stunned>
In other threads I have provided good advice of how to implement something and had it totally ignored. Here I deliberately provided bad advice and for some reason OP has zeroed in on it instead of the cleaner more sensible explanation. So now I know what I have to do in future in order to be "heard".
> So now I know what I have
> to do in future in order to be "heard".
The shorter the answer, the more likely it is to be ignored AFAICS. The long-winded answers with all the crappy code seem to get all the attention.
That doesn't stop me trying to post minimalist answers, though. It's just the way I am.