| Author |
Short sh = new Short( 2); is indefined?
|
Nikos Stavros
Ranch Hand
Joined: Feb 24, 2006
Posts: 243
|
|
I don't understand why in my code is indefined?
|
Jesus lives
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
Because there is no constructor in the Short class which takes an int value as a parameter. This will work:
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
Martin Simons
Ranch Hand
Joined: Mar 02, 2006
Posts: 196
|
|
well, Short can only be declared with a string or a short. Since a number typed in the manner it is there is, per default, an integer, that constructor is not defined. Fix in one of these two ways:
|
 |
Nikos Stavros
Ranch Hand
Joined: Feb 24, 2006
Posts: 243
|
|
of course thanks guys
|
 |
 |
|
|
subject: Short sh = new Short( 2); is indefined?
|
|
|