Search:

Type: Posts; User: Melawe

Search: Search took 0.19 seconds.

  1. Replies
    18
    Views
    2,199

    [SOLVED] Re: Return statement.

    Thanks everyone for taking the time to help! :D
  2. Replies
    18
    Views
    2,199

    [SOLVED] Re: Return statement.

    So the return statement gives back a value but doesn't print it.
  3. Replies
    18
    Views
    2,199

    [SOLVED] Re: Return statement.

    My bad misunderstood the code. I still don't understand what exactly return's job really is.
  4. Replies
    18
    Views
    2,199

    [SOLVED] Re: Return statement.

    class JavaClass {
    public static void main(String[] args) {

    int y = JavaObject.factorial(5) + JavaObject.factorial(3);
    System.out.println("y = " + y);

    }
    }...
  5. Replies
    18
    Views
    2,199

    [SOLVED] Re: Return statement.

    That actually is the output I got.
  6. Replies
    18
    Views
    2,199

    [SOLVED] Re: Return statement.

    class JavaObject {

    public static int factorial(int x) {
    int result = 1;
    for(int i = 1; i <= x; ++i) {
    result *= i;
    }
    return result;
    }
  7. Replies
    18
    Views
    2,199

    [SOLVED] Re: Return statement.

    So if I used a println statement and the method doesn't have a return statement, I wont be able to print anything?
  8. Replies
    18
    Views
    2,199

    [SOLVED] Return statement.

    Hello everyone.

    I am working on an assignment involving the return statement. What I have to do is create a private variable called newSeconds and make methods to change it's value only if it is...
Results 1 to 8 of 8