File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Type Conversions

 
Arun Kumarr
Ranch Hand
Posts: 661
Eclipse IDE Java Spring
  • 0
  • 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
  • 0
  • 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: 661
Eclipse IDE Java Spring
  • 0
  • 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