java - I cant take percent of any value of numbers in jtextfield -


i'm trying take %2 of anytypes of value in jtextfield. when press button, it's giving me result "0" . 0. can somone me ?

try{     int num1=integer.parseint(jtextfield6.gettext());      int result=num1%2;     jtextfield15.settext(""+result);          } catch(numberformatexception e) {  }    

what result when insert odd value? using modulo, 0 numbers can divided 2 without remainder after division (all values) , 1 rest.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -