Created
November 28, 2015 14:16
-
-
Save dmitrykolesnikovich/bdde0feb9c3f98f7b05c to your computer and use it in GitHub Desktop.
на что похож андроид сейчас
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
public class Test { | |
public static void main(String[] args) { | |
test1(); | |
test2(); | |
} | |
private static void test1() { | |
X x = new X(); | |
x.isStay = true; | |
x.doSomething(); | |
x.doSomething(); | |
} | |
private static void test2() { | |
X x = new X(); | |
x.doSomething(); | |
x.doSomething(); | |
} | |
} | |
class X { | |
public Object whatever = new Object(); | |
boolean isStay; | |
public void doSomething() { | |
if (!isStay) { | |
whatever = null; | |
} | |
System.out.println(whatever.hashCode()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment