aspose file tools*
The moose likes Beginning Java and the fly likes Type mismatch:cannot convert from int to Integer. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Type mismatch:cannot convert from int to Integer." Watch "Type mismatch:cannot convert from int to Integer." New topic
Author

Type mismatch:cannot convert from int to Integer.

Slaxmi Raj
Ranch Hand

Joined: Apr 20, 2012
Posts: 40

when i run this program , getting the error:type mismatch-can not convert int to Integer.
how i reduce this error, Anyone please tell me.

[Added code tags - see UseCodeTags for details]
Marcus Kelvin
Ranch Hand

Joined: Jan 04, 2012
Posts: 44
when i run this program , getting the error:type mismatch-can not convert int to Integer.


I don't get any errors for the code in the first post using oracle jdk 7 or icedtea jdk 6. What line is it on?

Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4392
    
    8

If you're using earlier than Java 1.5, then you'd expect line 14 to throw an error, because you're assigining an int to an Integer reference. Autoboxing allows that, but autoboxing was introduced in 1.5.

You do realise that if that line works it's a pointless statement, though?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Type mismatch:cannot convert from int to Integer.