class test{
boolean b;
private boolean c;
public static int a = 0;
public void method1(){
Girlfriend gf = new Girlfriend();
gf.gift(new PS3);
a++;
}
//execute method1();
}
method1 이 실행되면
나머지들은 내생각엔
1) boolean b; 랑 private boolean c; 는 바로 stack행
2) int a 는 global 에다가 new 해서 heap으로감
3) method1 은 stack에 method frame생성함
4) 그안에 gf stack 만들려던 참에 new라 heap으로 ㄱㄱㅆ
5) gf.gift() 또한 stack에 method frame 생성
6) new PS3 은 heap ㄱㄱㅆ
맞는감?
boolean b;
private boolean c;
public static int a = 0;
public void method1(){
Girlfriend gf = new Girlfriend();
gf.gift(new PS3);
a++;
}
//execute method1();
}
method1 이 실행되면
나머지들은 내생각엔
1) boolean b; 랑 private boolean c; 는 바로 stack행
2) int a 는 global 에다가 new 해서 heap으로감
3) method1 은 stack에 method frame생성함
4) 그안에 gf stack 만들려던 참에 new라 heap으로 ㄱㄱㅆ
5) gf.gift() 또한 stack에 method frame 생성
6) new PS3 은 heap ㄱㄱㅆ
맞는감?
댓글 0