Search:

Type: Posts; User: meowCat

Search: Search took 0.17 seconds.

  1. Replies
    5
    Views
    1,681

    Re: question on calculating

    Well, the point is not how to make it better, as this was an exam question.

    Seeing the answers now, I feel it's a bit unfair to ask that in a MC test. Ah well...thank you very much for the...
  2. Replies
    5
    Views
    1,681

    Re: question on calculating

    Hi,

    thanks for your reply. I am still confused though.
    the value of i before the confusing expression is 6.
    So I would expect something then like
    i += i
    i = 6+6
    =12
    then the increment =13....
  3. Replies
    5
    Views
    1,681

    question on calculating

    Hi everyone,

    I have this bit of code and I am really confused about the result:

    int i=5;
    if (i++ == 5 || false){
    System.out.println("before: "+i);

    i += i++;
    }
Results 1 to 3 of 3