Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
You cannot do directly what you are looking for. I think you have an int and you want to pass an argument or you want to work with an Object of Number class. You cannot directly cast an int or any primitive data type to a reference type. What you can do is create a Integer object as: Since Integer is a subclass of Number , you can use num anywhere you need Number. Thanx
Replies:
|
Sponsored Links
|