REPORT Z17_019.
INTERFACE object_status.
METHODS write_status.
ENDINTERFACE.
CLASS vehicle DEFINITION.
PUBLIC SECTION.
INTERFACES object_status.
ALIASES write_status FOR
object_status~write_status.
METHODS accelerate.
PROTECTED SECTION.
DATA speed TYPE i.
ENDCLASS.
CLASS vehicle IMPLEMENTATION.
METHOD accelerate.
speed = speed + 1.
ENDMETHOD.
METHOD
object_status~write_status.
WRITE: / 'Speed:', speed.
ENDMETHOD.
ENDCLASS.
DATA : vehicle_ref TYPE REF TO vehicle.
START-OF-SELECTION.
CREATE OBJECT vehicle_ref.
CALL METHOD: vehicle_ref->accelerate,
vehicle_ref->write_status.
INTERFACE object_status.
METHODS write_status.
ENDINTERFACE.
CLASS vehicle DEFINITION.
PUBLIC SECTION.
INTERFACES object_status.
ALIASES write_status FOR
object_status~write_status.
METHODS accelerate.
PROTECTED SECTION.
DATA speed TYPE i.
ENDCLASS.
CLASS vehicle IMPLEMENTATION.
METHOD accelerate.
speed = speed + 1.
ENDMETHOD.
METHOD
object_status~write_status.
WRITE: / 'Speed:', speed.
ENDMETHOD.
ENDCLASS.
DATA : vehicle_ref TYPE REF TO vehicle.
START-OF-SELECTION.
CREATE OBJECT vehicle_ref.
CALL METHOD: vehicle_ref->accelerate,
vehicle_ref->write_status.
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
231 | REPORT z18_028 | sapjoy | 2007.04.10 | 4281 |
230 | REPORT Z03_021 [5] | sapjoy | 2007.05.15 | 2737 |
229 | REPORT z18_002_d | sapjoy | 2008.04.16 | 2088 |
228 | REPORT Z18_000 [1] | sapjoy | 2008.04.16 | 2602 |
» | REPORT Z17_019 [1] | sapjoy | 2007.02.15 | 2748 |
226 | REPORT Z17_018. | sapjoy | 2008.04.15 | 1860 |
225 | REPORT Z17_014. [1] | sapjoy | 2007.02.13 | 2504 |
224 | Report Z15_047 [3] | sapjoy | 2007.12.06 | 2798 |
223 | REPORT Z15_044 [1] | sapjoy | 2008.04.15 | 2474 |
222 | REPORT Z15_039 | sapjoy | 2007.02.06 | 2315 |
221 | REPORT Z15_037. | sapjoy | 2007.02.06 | 2472 |
220 | REPORT Z15_033 | sapjoy | 2007.02.06 | 2987 |
219 | REPORT z15_032 | sapjoy | 2007.02.06 | 2578 |
218 | REPORT Z15_028 | sapjoy | 2007.02.01 | 2509 |
217 | REPORT Z15_026 [1] | sapjoy | 2007.09.13 | 2205 |
216 | REPORT Z15_026 | sapjoy | 2007.02.01 | 2758 |
215 | REPORT Z15_025 | sapjoy | 2008.04.15 | 1975 |
214 | REPORT z15_023 | sapjoy | 2007.01.31 | 2484 |
213 | REPORT Z15_022. | sapjoy | 2007.01.30 | 2495 |
212 | REPORT Z15_020 | sapjoy | 2007.01.30 | 2524 |
CLASS counter DEFINITION.
PUBLIC SECTION.
METHODS: set IMPORTING value(set_value) TYPE i,
increment,
get EXPORTING value(get_value) TYPE i.
PROTECTED SECTION.
DATA count TYPE i.
ENDCLASS.
CLASS counter IMPLEMENTATION.
METHOD set.
count = set_value.
ENDMETHOD.
METHOD increment.
ADD 1 TO count.
ENDMETHOD.
METHOD get.
get_value = count.
ENDMETHOD.
ENDCLASS.
CLASS counter_ten DEFINITION INHERITING FROM counter.
PUBLIC SECTION.
METHODS increment REDEFINITION.
DATA count_ten.
ENDCLASS.
CLASS counter_ten IMPLEMENTATION.
METHOD increment.
DATA modulo TYPE i.
CALL METHOD super->increment.
write / count.
modulo = count mod 10.
IF modulo = 0.
count_ten = count_ten + 1.
write count_ten.
ENDIF.
ENDMETHOD.
ENDCLASS.
DATA: count TYPE REF TO counter,
number TYPE i VALUE 5.
START-OF-SELECTION.
CREATE OBJECT count TYPE counter_ten.
CALL METHOD count->set EXPORTING set_value = number.
DO 20 TIMES.
CALL METHOD count->increment.
ENDDO.