aspose file tools*
The moose likes Beginning Java and the fly likes Type Conversions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Type Conversions" Watch "Type Conversions" New topic
Author

Type Conversions

Arun Kumarr
Ranch Hand

Joined: May 16, 2005
Posts: 513

class parentneighbour {

long lo =999999999999999999L;
int i =123;
float f = lo; //no compiler error
}

How is that a Long which doesn't fit into a float is automatically typecasted?

I'm using JDK1.4.1_02


If you are not laughing at yourself, then you just didn't get the joke.
Ta Ri Ki Sun
Ranch Hand

Joined: Mar 26, 2002
Posts: 442
You'll find the following link useful
cast mixing
Arun Kumarr
Ranch Hand

Joined: May 16, 2005
Posts: 513

Thank you.
The Link was sure helpful.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Type Conversions