class BirthDate {
private int day;
private int month;
private int year;
private B b;
public BirthDate(int d, int m, int y, B b) {
day = d;
month = m;
year = y;
this.b = b;
}
// 省略get,set方法………
}
public class Test{
public static void main(String args[]){
int date = 9;
Test test = new Test();
test.change(date);
BirthDate d1= new BirthDate(7,7,1970);
}
public void change1(int i){
i = 1234;
}
如上,请问类BirthDate的成员属性B b在jvm内存是怎么存放的,是放在堆上吗?还是相当于只存引用,而对象b单独有自己的一块内存区域?