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

Widening

Ramm Kummar
Greenhorn

Joined: Feb 10, 2009
Posts: 26




Edited by: bobz on 23-Mar-2009 08:33
Harshit Rastogi
Ranch Hand

Joined: Apr 15, 2008
Posts: 131
you cannot define i as float....
declare i as double instead of float


<a href="http://technologiquepanorama.wordpress.com" target="_blank" rel="nofollow">My Techie Blog</a><br /><a href="http://www.java-questions.com" target="_blank" rel="nofollow">Java Questions</a>
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38818
    
  23
If you want i as a float you have to provide a float literal

float i = 5f.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19693
    
  20

That still wouldn't compile, because a float is wider than a long, and can't even be compared successfully against Integer.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38818
    
  23
No, Rob you are right. I hadn't noticed that bit. Passing incorrect argument types to a method.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Widening