Answer and Explanation:
The given program creates two objects of class Book.When two or more objects of the same class are created, each object contains its own value in the memory.The data members of each object are separate to store the values of a particular object. However the member function of the class are created only once in the memory.These member functions are shared by all objects of the class.
Object 1 contain
Book ID = 1
Title = Programming fundamentals
Object 2 contain
Book ID = 2
Title = data structure and logic
then apply methods which are as follow:
get()
show()
set()
get Title()
Above are the creation of objects.
The above statement shows that all objects have their own memory address to store the values of data member.However, all objects share the same copy of member functions.