Show TOC

Code Example Before ExecutionLocate this document in the navigation structure

CLASS cx_error DEFINITION 
  INHERITING FROM cx_static_check. 
ENDCLASS. 


CLASS cl_car DEFINITION. 
  PUBLIC SECTION. 
    METHODS: drive 
      IMPORTING 
        i_speed TYPE i 
      RAISING 
        cx_error. 
ENDCLASS. 


CLASS cl_car IMPLEMENTATION. 
  METHOD drive. 
    IF i_speed < 0. 
      RAISE EXCEPTION TYPE cx_error. 
    ENDIF. 
  ENDMETHOD. 
ENDCLASS.