Search:

Type: Posts; User: newbie

Search: Search took 0.12 seconds.

  1. Replies
    8
    Views
    1,757

    [SOLVED] Re: Can't get output HELP

    if (condition1IsTrue) {
    //do something
    } else if (condition2IsTrue) {
    //do something else
    } else {
    //do something if NONE of the above conditions hold}
    }

    Currently,...
  2. Replies
    8
    Views
    1,757

    [SOLVED] Re: Can't get output HELP

    No.. it lies with how you're returning.
    If(n<0) is a condition itself...So thats not always going to be true.
    Place a return inside an else clause.
  3. Replies
    8
    Views
    1,757

    [SOLVED] Re: Can't get output HELP

    public static int fact(int n) {
    Is a method that returns an Integer value.
    You are returning values only if a condition holds.
    If that condition doesn't hold, then the method won't return...
Results 1 to 3 of 3