Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Translating Boolean true/false into Yes/No of what I am doing wrong

843785Feb 8 2009 — edited Feb 8 2009
Having a hard time figuring out how to translate this. Here is the method I think should do it:

instance variable:
private boolean isPaperback;
Method:
   public void translate(boolean trueOrFalse)
    {
        if (isPaperback = true) {
            System.out.println("Yes");
          }
        else {
            System.out.println("No");
        }
    }
When I run the method, it gives me an answer of "Yes" for both true and false. Any idea of what I am doing wrong?

TIA, Marc

Edited by: Celtica on Feb 9, 2009 12:33 AM

Edited by: Celtica on Feb 9, 2009 12:34 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 8 2009
Added on Feb 8 2009
11 comments
538 views