Skip to content

Instantly share code, notes, and snippets.

@dmitrykolesnikovich
Created November 28, 2015 14:16
Show Gist options
  • Save dmitrykolesnikovich/bdde0feb9c3f98f7b05c to your computer and use it in GitHub Desktop.
Save dmitrykolesnikovich/bdde0feb9c3f98f7b05c to your computer and use it in GitHub Desktop.
на что похож андроид сейчас
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