Search:

Type: Posts; User: pbrockway2

Search: Search took 0.10 seconds.

  1. Re: Iterate over array, changing current object?

    It's perhaps a nitpick, but it would be more accurate to say that invoking methods on a variable affects the state of the object referenced by that variable's value. Invoking methods never changes...
  2. Re: Iterate over array, changing current object?

    Object[] temp = {"foo", null, "bar"};
    for(Object ob :temp){
    if(ob == null) {
    ob = "???";
    } else {
    ob = null;
    }


    The situation here is exactly the same as in (B). ob is a local...
Results 1 to 2 of 2