Results 1 to 3 of 3

Thread: return{Resolved}

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Posts
    103

    return{Resolved}

    public int woo(int a){

    int y = 78;

    for(int i=0; i<100; i+10){ //i+10 is invalid
    if (i == a)
    return y;
    }

    return a;

    }

    I want the method to return 'y' if 'a' == 'i'.

    if i == a, will the for loop be stopped (no further loops) and y be returned (ending the method)?
    therefore, if i != a, a will be returned?

    by the way, how do i get the increment of i to be +10 in every pass?
    Last edited by Dilenger4; Sep 5th, 2003 at 12:37 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
  •  



Click Here to Expand Forum to Full Width