wood burning stoves 2.0*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Type Conversions
 
Similar Threads
*****primitive type casting issue******
Geeky Math Question
Hi
Not able to understand the output
Wrapper arguments