PDA

View Full Version : In aggregation we use a pointer e.g. like chair object in a room class



saneha
05-02-2011, 04:48 PM
In aggregation we use a pointer e.g. like chair object in a room class

Vuhelper
05-02-2011, 04:48 PM
In aggregation, you know very well that container class holds the pointer of contained class in order to perform specific functions like in your given example, chair is aggregated in Room class........means Room has the pointer of Chair Object.......Whenever, Room class needs some functionality like Chair Adjustment(........ ) in Room class, then, definitely by using the pointer of Chair, this kind of functionality can be achieved, please be remember that this function is defined in Chair class.