Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Type Conversions  RSS feed

 
Arun Kumarr
Ranch Hand
Posts: 662
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll find the following link useful
cast mixing
 
Arun Kumarr
Ranch Hand
Posts: 662
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.
The Link was sure helpful.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!