Information Technology Reference
In-Depth Information
will create an new instance of class department. The example is passing a message
to DEPARTMENT class object without directly operating on their attribute values.
Inheritance Attributes and methods were inherited from its superclass, and added
new attributes and methods for the inherited object. For example,
&DOOVKRZBDOOBLQVWDQFHVRQFODVVIWBVWXGHQW
will display all instances which belong to class ft_student.
)UDPHPRGHOPHWDGDWD
+HDGHU&ODVV
&ODVVB1DPH
3ULPDU\BNH\
3DUHQWV
2SHUDWLRQ
&ODVVBW\SH
3$57B7,0(B6
78'(17
678'(17
67$))
1(:
$&7,9(
Polymorphism
The same method call will give different results on different class objects. For
example,
FDOOVKRZBDOOBLQVWDQFHRQFODVVGHSDUWPHQW
FDOOVKRZBDOOBLQVWDQFHRQFODVVSHUVRQ
will have different results. The following result will be displayed on the screen:
Abstract Data Type and Multiple Values The type of an attribute can be defined as
any predefined class or as a set of objects. For example, in the prototype CLASS
course, the attribute method
)DPHPRGHOPHWDGDWD
0HWKRG&ODVV
&ODVVBQDPH
0HWKRG
BQDPH
3DUDP
HWHUV
6HTXHQ
FHBQR
0HWKR
GBW\SH
&RQG
LWLRQ
$FWLRQ
1H[WBVHT
XHQFHBQR
6+2:B$//
B,167$1&(
'(3$5
70(17
64/
6(/(&7
)520
'(3$570(17
0HWKRG&ODVV
&ODVVBQDPH
0HWKRG
BQDPH
3DUDP
HWHUV
6HTXHQ
FHBQR
0HWKR
GBW\SH
&RQG
LWLRQ
$FWLRQ
1H[WBVHT
XHQFHBQR
6+2:B$//
B,167$1&(
3(562
1
64/
6(/(&7
)5203(5621
Call set_of_student_registered(course_no)
Search WWH ::




Custom Search