my dog learned polymorphism*
The moose likes Struts and the fly likes what is difference between  0" ?" title="" /> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "what is difference between  "min = 1"  and "age>0" ?" Watch "what is difference between  "min = 1"  and "age>0" ?" New topic
Author

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

dhaval thakor
Ranch Hand

Joined: Aug 27, 2012
Posts: 53


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

Joined: Oct 29, 2001
Posts: 8876
    
    8

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
dhaval thakor
Ranch Hand

Joined: Aug 27, 2012
Posts: 53

Thank you very much..
now i clearly understood the difference
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what is difference between "min = 1" and "age>0" ?