Two Laptop Bag*
The moose likes Beginning Java and the fly likes autoboxing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "autoboxing" Watch "autoboxing" New topic
Author

autoboxing

vidu sri
Greenhorn

Joined: Jun 15, 2009
Posts: 8

why do i get exception in thread when i run the program
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3775

(Hint: "j=i; " line causes the exception here. When unboxing an Integer to int using intValue() method)

Do you see what those variables are referring to (specially i)?

EDIT : I had edited the wrong post earlier.




SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3775

REMOVED : Duplicate
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36478
    
  16
Please supply more details; tell us what exception you are suffering (though Vijatha Kumar has guessed it ) and show us the stack trace, because that has useful line numbers on.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3775

Campbell Ritchie wrote:Please supply more details; tell us what exception you are suffering (though Vijatha Kumar has guessed it ) and show us the stack trace, because that has useful line numbers on.


Oh! It was too early to answer that
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: autoboxing
 
Similar Threads
Boolean.valueOf("True") returns true
why null pointer exception?
Testing classes
Head First sharpen your pencil question
Exercise Head first of Java public class TestBox