4
$\begingroup$

Which famous quote is this simple Java code representing?

public class Foo {

    private int result = 38;

    public void foo() {
        do {
            thing(result);
        } while (result == 38);
    }

    public void thing(int i) {
        i += 19;
    }

    public static void main(String[] args) {
        new Foo().foo();
    }

}

P.S.: Sorry, I know it's easy

$\endgroup$
4
$\begingroup$

This:

Insanity: doing the same thing over and over again and expecting different results. Albert Einstein

$\endgroup$
  • $\begingroup$ I agree with your answer. But I can't remember if java is pass by reference or pass by copy by default... $\endgroup$ – Going hamateur Aug 3 '16 at 14:29
  • $\begingroup$ @Goinghamateur It's pass by value. Primitive types, like in this example, just get copied. If you're interested: I just found more detailed explanations here. $\endgroup$ – user14478 Aug 3 '16 at 14:36
  • $\begingroup$ Thankee, I found a very good comment about balloons to clarify everything for me. $\endgroup$ – Going hamateur Aug 3 '16 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy