Constructor



  • Constructor  is special type of methods whose name is constructor.
  • Constructors are executes automatically when object of the class is created.
  • Always Constructor’s visibility is public.
  • 2 types.
  1. Instance constructor.
  2. Static constructor.
  • Instance constructor called automatically when object is created.
  • Instance constructor can be called as per number of objects are created.
  • Instance constructor can be called method name "CONSTRUCTOR".
  • An instance constructor can have IMPORTING parameters and exceptions. You must pass all non-optional parameters when creating an object.


  • Static constructor can be called only once when class has been loaded.
  • Static constructor has 1st priority than Instance Constructor.
  • Static constructor can be called  method name " CLASS_CONSTRUCTOR".
  •  Static constructors have no parameters.

Comments

Popular posts from this blog

RADIO-BUTTONS IN BASIC REPORT

ALV-LIGHT_SET