Posts

Showing posts from March, 2022

Special Method: Constructor

Image
  Introduction:    We will cover the following basic concepts: Understand, what are constructors. Simple example class, specially designed to understand the basics of Constructors. Create a program to demonstrate different ways constructors behave. Why Constructors? 1. So, what are constructors? Let us understand the basics of the constructors by studying simple differences between normal methods and constructors. 2. Let us start our example by creating a HANA Eclipse class with the below structure. We will create the below 4 methods in the visibility  PUBLIC SECTION of the CLASS DEFINITION . Create a Special Instance Method Constructor with the name CONSTRUCTOR, this is the default name we use to create an instance constructor. We will also create a Normal Instance Method with the name INSTANCE_METHOD. Create a Special Static Method Constructor with the name CLASS_CONSTRUCTOR, this is the default name we use to create a static constructor. And similarly we will ...