正在加载图片...
OoP/ Slide 14 Operators for members The dot operator not only for public member variables of an object, but also for public member functions(during usage),e.g Temperature templi templ celsius ()i function→ method templ print ()i Function(procedure)call> message Comments: 1. Temp1 receives print()message and displays values stored in degree and scale, receives celsius( message to give the temperature in celsius 2. It is not the function which is calling the object like print(temp 1)traditionally, temp 1. print(> object oriented 3. The temperature are 'smart objects unlike 'stupid basic type objectsOOP / Slide 14 Operators for members The dot operator not only for public member variables of an object, but also for public member functions (during usage), e.g. Temperature temp1; temp1.celsius(); temp1.print(); 1. Temp1 receives print() message and displays values stored in degree and scale, receives celsius() message to give the temperature in celsius … 3. The temperature are ‘smart objects’ ☺ unlike ‘stupid’ basic type objects Comments: 2. It is not the function which is calling the object like print(temp1) traditionally, temp1.print() → object oriented! function → method Function(procedure) call → message
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有