Results 1 to 4 of 4

Thread: Simple Boolean

  1. #1
    jigglywiggly is offline Senior Member
    Join Date
    Nov 2008
    Posts
    105
    Rep Power
    0

    Default Simple Boolean

    I have taken a long break from java, so my head is rusty. I have this question, pretty simple.
    Basically this boolean just wants to check if d1,d2,d3,d4 all = 0
    public class Diffy {

    private int d1;
    private int d2;
    private int d3;
    private int d4;

    public boolean isZero() {
    boolean d = false;
    if(d1==0 && d2==0 && d3==0 && d4==0) {
    d=true;
    }
    So I wrote that, is that super wrong? I have no idea, thanks.

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

  3. #3
    jigglywiggly is offline Senior Member
    Join Date
    Nov 2008
    Posts
    105
    Rep Power
    0

    Default

    Oh I am stupid I forgot to return something, your comment just reminded me I forgot to return. Thanks a bunch:):):)

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Normally the error message explain it more clearly. Seems you didn't read it carefully. ;)

    Anyway, if you have solve the problem please mark it as solved.

Similar Threads

  1. [SOLVED] Boolean Expression Evaluation Framework
    By priyanka.dandekar in forum Advanced Java
    Replies: 8
    Last Post: 03-27-2010, 03:35 PM
  2. [SOLVED] boolean method problem
    By shadowblade19 in forum New To Java
    Replies: 6
    Last Post: 11-30-2008, 03:01 AM
  3. boolean to string
    By otoro_java in forum New To Java
    Replies: 2
    Last Post: 01-30-2008, 06:31 AM
  4. boolean variables
    By ravian in forum New To Java
    Replies: 3
    Last Post: 12-31-2007, 05:58 AM
  5. Boolean Expression
    By ritwik07 in forum New To Java
    Replies: 3
    Last Post: 07-11-2007, 05:11 AM

Posting Permissions

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