• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

boolean returns1

 
Ranch Hand
Posts: 582
11
Android Python Open BSD VI Editor Slackware
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

HI, on a tutorial i have this method create that should return a boolean (so a true/false) that returns a 1? which core concept I am missing?
I saw in the BeanPropertySqlParameterSource documentation four update methods but they have an int type not boolean



in the case
 
author
Posts: 23928
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Giovanni Montano wrote:
HI, on a tutorial i have this method create that should return a boolean (so a true/false) that returns a 1? which core concept I am missing?
I saw in the BeanPropertySqlParameterSource documentation four update methods but they have an int type not boolean



If you look (all the way) on the right side of the return expression, you will see that the update() method return value is compared to a value of one. This is done via the "==" operator. The result of this comparison is, of course, yields a boolean value.

Henry
 
Ranch Hand
Posts: 198
Oracle Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Look carefully, the method is not returning 1, Its comparing the result of jdbc.update method with 1.
If both are equal it will return true else it will return false.
 
Giovanni Montano
Ranch Hand
Posts: 582
11
Android Python Open BSD VI Editor Slackware
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Henry Wong wrote:

If you look (all the way) on the right side of the return expression, you will see that the update() method return value is compared to a value of one. This is done via the "==" operator. The result of this comparison is, of course, yields a boolean value.

Henry


D'OH! of course! Now make perfect sense thank you also to Manoj
 
It's hard to fight evil. The little things, like a nice sandwich, really helps. Right tiny ad?
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic