| Author |
How to modify this program to use & display 1s and 0s instead of true and false?
|
bill kim
Greenhorn
Joined: Nov 10, 2011
Posts: 2
|
|
|
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
Call this method to convert a boolean to an int in the way you described.
|
 |
Wouter Oet
Saloon Keeper
Joined: Oct 25, 2008
Posts: 2700
|
|
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?
|
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
|
 |
bill kim
Greenhorn
Joined: Nov 10, 2011
Posts: 2
|
|
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
Saloon Keeper
Joined: Oct 25, 2008
Posts: 2700
|
|
You need to use it where you want the output, so:
|
 |
 |
|
|
subject: How to modify this program to use & display 1s and 0s instead of true and false?
|
|
|