As in the below program, i instantiated an Store object in the Book class member field. Is this command allocates memory inside every Book class object space in heap or once in a free area of heap and assign the address to it ?
public class Book{
private String bookName;
private Store count = new Store(10);
public Book(String bookName ) {
this.bookName = bookName;
}
public void display(){
System.out.println(this.bookName);
}
public static void main(String[] args) {
Book main = new Book("Machines");
main.display();
System.out.println(main.count.bookCount);
}
}