Results 1 to 5 of 5
  1. #1
    shacht1 is offline Member
    Join Date
    Nov 2009
    Posts
    2
    Rep Power
    0

    Default Wrong output (well.. the one who's wrong is probably me ;) )

    Why do i get the output when the boolean value is false??
    Attached Thumbnails Attached Thumbnails Wrong output (well.. the one who's wrong is probably me ;) )-capture.jpg  

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Please post your code here if you can using code tags, not an image.

    If you do this:
    Java Code:
    if (myBoolean = true) { // = means assignment
    you are SETTING myBoolean to true. Better would be:
    Java Code:
    if (myBoolean == true) { // == means testing for equailty
    and BEST would be:
    Java Code:
    if (myBoolean) {  // don't even need == true here

  3. #3
    shacht1 is offline Member
    Join Date
    Nov 2009
    Posts
    2
    Rep Power
    0

    Default Thanks!!

    i'll use the code function from now on

  4. #4
    tnd_blazer is offline Member
    Join Date
    Jun 2013
    Posts
    12
    Blog Entries
    1
    Rep Power
    0

    Default Re: Wrong output (well.. the one who's wrong is probably me ;) )

    He's right if you post the whole thing in text thay can help you more.

  5. #5
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,641
    Rep Power
    7

    Default Re: Wrong output (well.. the one who's wrong is probably me ;) )

    @tnd_blazer, welcome to the forums. Please note the date on the original post - its been 3 1/2 years since this was posted. For a list of reasons, please avoid resurrecting extremely old posts.

    Thread locked.

Similar Threads

  1. what am i doing wrong here??
    By tornbacchus in forum New To Java
    Replies: 19
    Last Post: 04-16-2009, 03:54 AM
  2. what's wrong?
    By rayda in forum New To Java
    Replies: 3
    Last Post: 04-14-2009, 09:07 PM
  3. What did i do wrong
    By jpnym15 in forum New To Java
    Replies: 8
    Last Post: 11-17-2008, 10:07 AM
  4. what's wrong in here!!!
    By Annatar in forum New To Java
    Replies: 8
    Last Post: 11-14-2008, 02:55 AM
  5. So, what am I doing wrong?
    By Charles_Smith in forum New To Java
    Replies: 0
    Last Post: 10-29-2008, 02:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •