Showing posts with label Polymorphism. Show all posts
Showing posts with label Polymorphism. Show all posts

Monday, 7 November 2016

CL_OBJECT_COLLECTION, iterator and Polymorphism

Suppose I have a requirement to calculate the total area of a series of shape, for example circle and rectangle.

So I have two classes, circle and rectangle, both have a method get_area to return their area:

class ZCL_CIRCLE definition
  public
  final
  create public.