• Post Reply Bookmark Topic Watch Topic
  • New Topic

Short sh = new Short( 2); is indefined?  RSS feed

 
Nikos Stavros
Ranch Hand
Posts: 243
Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand why in my code


is indefined?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because there is no constructor in the Short class which takes an int value as a parameter. This will work:
 
Martin Simons
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 243
Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
of course

thanks guys
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!