• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is difference between "min = 1" and "age>0" ?

 
dhaval thakor
Ranch Hand
Posts: 53
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

suppose age field in action class

we are putting constraint that age should be min = 1 and max =21
like this
we can also put constraint like age>0 and max =21

what is difference between in that two constraint while using this in annotation in struts?
my teacher says it has difference ..but still i not getting what difference between them.?
 
Joe Ess
Bartender
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dhaval thakor wrote:
my teacher says it has difference ..but still i not getting what difference between them.?


If age is an integer, I don't think there is a difference because the first value that is greater than zero is 1. If age is a floating point number, there are values between 0 and 1, for example, .05.
 
dhaval thakor
Ranch Hand
Posts: 53
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much..
now i clearly understood the difference
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic