• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to modify this program to use & display 1s and 0s instead of true and false?  RSS feed

 
bill kim
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Paul Clapham
Sheriff
Posts: 22823
43
Eclipse IDE Firefox Browser MySQL Database
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Call this method to convert a boolean to an int in the way you described.
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi and welcome to the JavaRanch.

I've edited your post and added code tags making it much easier to read. Please do so in the future.

We are NotACodeMill, what have you tried? What failed? And why?
 
bill kim
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you guys!!

Paul Clapham, where should I put your code? and why?

Wouter Oet, I'll follow the rule in the future. Well, I'm trying to use and show 1s and 0s instead of true and false. I've replaced true to 1 and false to 0.
compiler says "incompatible types. found: int, required: boolean"
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to use it where you want the output, so:

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