Chinaunix首页 | 论坛 | 博客
  • 博客访问: 98465
  • 博文数量: 38
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 460
  • 用 户 组: 普通用户
  • 注册时间: 2014-12-27 21:11
文章分类

全部博文(38)

我的朋友

分类: 信息化

2015-05-16 22:05:38


REPORT  zthomas_oo_pattern_singleton.
*----------------------------------------------------------------------*
*       CLASS lcl_vehicle DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_vehicle DEFINITION.
  PUBLIC SECTION.
    METHODS:initial IMPORTING name TYPE string.
ENDCLASS.                    "lcl_vehicle DEFINITION
*----------------------------------------------------------------------*
*       CLASS lcl_vehicle IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_vehicle IMPLEMENTATION.
  METHOD initial.
    WRITE:/ 'this is', name.
  ENDMETHOD.                    "initial
ENDCLASS.                    "lcl_vehicle IMPLEMENTATION
DATA:lo_car TYPE REF TO lcl_vehicle.
START-OF-SELECTION.
*CREATE OBJECT lo_car.
  IF lo_car IS NOT BOUND.
    CREATE OBJECT lo_car.
  ELSE.
    MESSAGE 'you have created this object' TYPE 'S' DISPLAY LIKE 'E'.
  ENDIF.
CALL METHOD lo_car->initial
    EXPORTING
      name = 'truck'.
阅读(543) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~