Posts

Showing posts from May, 2022

Abstract Class

Image
        Introduction:    We will cover the following basic concepts: Basics of Abstract Class . Example Class to understand practical implications . Example program to implement the methods of the class . Why Abstract Class? Lets Start 1. First let us compare Normal Class and Abstract Class. Below comparison will give us a basic understanding of an abstract class . 2. Let us create an Abstract Class example to understand the practical implications. Create an Abstract Class as shown below. LINE 3: To make a class abstract class we need to add the keyword ABSTRACT  in the definition section. LINE 6:Let us define an abstract method using the same keyword as above. METHODS :ABSTRACT_METHOD ABSTRACT . LINE7: Define a non-abstract method. METHODS : NORMAL_METHOD. LINE8:Lets try to define a static abstract method. CLASS-METHODS : STATIC_ABSTRACT_METHOD ABSTRACT . Interestingly, we cannot define a static method as an abstract method. This is because stat...

Friend Class Indeed

Image
      Introduction:    We will cover the following basic concepts: Understand the basics of Friend Class. Create an example to understand the working of a friend class. Create a program to run the methods of the example classes. Why do we need a Friend Class? Lets Start 1. First let us understand theoretically the working of the friend class from the below comparison. Let us compare CLASS INHERITANCE and FRIEND CLASS to understand the basics of friendship. Comparison Table 2. Let us create an example to demonstrate the working of the Friend Class. Let us first create a Global Interface . Define a Static Attribute IV_INTERFACE_ATTR. Define a Method named METHOD. Save, Check & Activate. Let us create a HANA Eclipse Class 'ZCLASS_FRIEND' -> class granting the friendship. Here we will add the Created Interface 'ZGLOBAL_INTERFACE' in the PUBLIC SECTION . Create the Method 'PRIVATE_FRIEND_METHOD' in the class's PRIVATE SECTION . This class will grant fr...