The document discusses inheritance in object-oriented programming. It defines inheritance as a class deriving from an existing class, allowing the derived class to access members of the base class. It describes three types of inheritance: public, private, and protected. It provides examples of single and multiple inheritance, and discusses how constructors are handled in derived classes.
The document discusses constructors and destructors in C++. It describes constructor functions as special member functions that initialize object values when an object is created. It covers default constructors, parameterized constructors, copy constructors, and constructor overloading. Destructors are described as special functions that destroy objects and perform cleanup when objects go out of scope. The key characteristics and uses of constructors and destructors are summarized with examples.
This document discusses packages in Java. It defines a package as a mechanism to encapsulate a group of classes, subpackages, and interfaces. Packages are used to prevent naming conflicts, make classes and interfaces easier to locate and use, and provide access control. Package names are related to directory structure, and packages can be considered a form of data encapsulation. The document also discusses built-in packages that are part of the Java API, as well as how to define and use user-defined packages through directory structure and import statements.
C language supports a character set of 256 characters including lowercase and uppercase English alphabets (a-z and A-Z), digits (0-9), and special symbols like mathematical, logical, and punctuation symbols. Every character has a corresponding ASCII value. A C program is provided that prints all the characters in the C character set along with their ASCII values to demonstrate the set of characters supported.
This document discusses templates in C++. Templates allow functions and classes to work with multiple data types without writing separate code for each type. There are two types of templates: class templates, which define a family of classes that operate on different data types, and function templates, which define a family of functions that can accept different data types as arguments. Examples of each template type are provided to demonstrate how they can be used to create reusable and flexible code.
Constructors are special member functions used to initialize objects. There are three types of constructors: 1) default constructors which have no arguments, 2) parameterized constructors which can take arguments to initialize objects, and 3) copy constructors which initialize an object from another existing object. Constructors are automatically called when objects are created, take the class name, and cannot return values or be defined as private. They play an important role in initializing class objects.
INTRODUCTION
COMPARISON BETWEEN NORMAL FUNCTION AND INLINE FUNCTION
PROS AND CONS
WHY WHEN AND HOW TO USED?
GENERAL STRUCTURE OF INLINE FUNCTION
EXAMPLE WITH PROGRAM CODE
The document discusses constructors and destructors in C++. It describes constructor functions as special member functions that initialize object values when an object is created. It covers default constructors, parameterized constructors, copy constructors, and constructor overloading. Destructors are described as special functions that destroy objects and perform cleanup when objects go out of scope. The key characteristics and uses of constructors and destructors are summarized with examples.
This document discusses packages in Java. It defines a package as a mechanism to encapsulate a group of classes, subpackages, and interfaces. Packages are used to prevent naming conflicts, make classes and interfaces easier to locate and use, and provide access control. Package names are related to directory structure, and packages can be considered a form of data encapsulation. The document also discusses built-in packages that are part of the Java API, as well as how to define and use user-defined packages through directory structure and import statements.
C language supports a character set of 256 characters including lowercase and uppercase English alphabets (a-z and A-Z), digits (0-9), and special symbols like mathematical, logical, and punctuation symbols. Every character has a corresponding ASCII value. A C program is provided that prints all the characters in the C character set along with their ASCII values to demonstrate the set of characters supported.
This document discusses templates in C++. Templates allow functions and classes to work with multiple data types without writing separate code for each type. There are two types of templates: class templates, which define a family of classes that operate on different data types, and function templates, which define a family of functions that can accept different data types as arguments. Examples of each template type are provided to demonstrate how they can be used to create reusable and flexible code.
Constructors are special member functions used to initialize objects. There are three types of constructors: 1) default constructors which have no arguments, 2) parameterized constructors which can take arguments to initialize objects, and 3) copy constructors which initialize an object from another existing object. Constructors are automatically called when objects are created, take the class name, and cannot return values or be defined as private. They play an important role in initializing class objects.
INTRODUCTION
COMPARISON BETWEEN NORMAL FUNCTION AND INLINE FUNCTION
PROS AND CONS
WHY WHEN AND HOW TO USED?
GENERAL STRUCTURE OF INLINE FUNCTION
EXAMPLE WITH PROGRAM CODE
Data abstraction is the process of hiding unnecessary implementation details and exposing only essential information to the user. It separates the interface from the implementation. In Python, data abstraction can be achieved through abstract classes, which cannot be instantiated directly but can be inherited. Abstract classes define a common API for subclasses and allow concrete methods to be implemented only once for all subclasses. Data abstraction improves flexibility, reusability, and makes working on large codebases with teams easier.
The document provides an overview of object-oriented programming concepts in .NET such as classes, objects, methods, constructors, destructors, inheritance, polymorphism, interfaces, access modifiers, and static members. It defines each concept and provides examples to illustrate how they are implemented in C#.
The document discusses modular programming, which involves separating a program into independent, interchangeable modules that each contain everything needed to execute one aspect of the desired functionality. Modular programming makes programs easier to understand, manage complexity through smaller blocks of code, encourage code re-use, and allow independent development of code. It provides an example program that defines a function to find the maximum of two numbers and calls that function from the main program. Advantages of modular programming include that modules can be written and tested separately, reused, and allow large projects to be developed in parallel.
1. Inheritance is a mechanism where a new class is derived from an existing class, known as the base or parent class. The derived class inherits properties and methods from the parent class.
2. There are 5 types of inheritance: single, multilevel, multiple, hierarchical, and hybrid. Multiple inheritance allows a class to inherit from more than one parent class.
3. Overriding allows a subclass to replace or extend a method defined in the parent class, while still calling the parent method using the super() function or parent class name. This allows the subclass to provide a specific implementation of a method.
This document provides an introduction to object-oriented programming concepts in C++ including objects, classes, encapsulation, inheritance, polymorphism, and more. It explains the basic structure of a C++ program and demonstrates how to write a simple "Hello World" program. It also covers basic C++ elements like variables, data types, comments, strings, arithmetic operators, and input/output.
Inheritance allows classes to establish a hierarchical relationship between base and derived classes so that the derived class can inherit attributes and behaviors from the base class. There are several types of inheritance including single, multilevel, and multiple inheritance. Visibility modes like public, private, and protected determine which members are inherited from the base class. Virtual base classes are used to resolve ambiguities that can arise from multiple inheritance hierarchies sharing a common base class.
Header files contain function and variable definitions that are imported into C++ programs using the #include statement. Header files have a ".h" extension and declare functions and define macros. When a function is used in a C++ program, its definition must be imported from the library by including the appropriate header file. Common header files provide input/output operations (iostream.h), console input/output (conio.h), formatted I/O (iomanip.h), strings (string.h), mathematics functions (math.h), general purpose functions like memory management (stdlib.h), and random number generation (stdlib.h).
C++ is an object-oriented programming language developed by Bjarne Stroustrup at Bell Labs as an extension of C with the addition of classes. A simple C++ program consists of including header files, defining classes and their functions, and a main function that uses the classes. The program demonstrates input using cin and output using cout to display the sum and average of two numbers entered by the user.
- A ref cursor is a variable that references the result of a cursor, allowing it to be passed between procedures and functions.
- Ref cursors can be weakly typed, where the returned data type is unknown, or strongly typed by defining the row type being returned.
- Examples show opening a ref cursor, passing it to other procedures to be processed, and closing the cursor once processing is complete. Ref cursor variables point to a single underlying cursor.
The document discusses different types of loops and conditional statements in programming languages. It explains the if, if-else, and switch conditional statements, providing examples of each. It also covers different types of loops - while, do-while, for, and nested loops. Examples are given to illustrate the syntax and usage of each loop and conditional statement.
A function is a group of statements that together perform a task. Every C program has at least one function, which is main(), and all the most trivial programs can define additional functions. You can divide up your code into separate functions.
C++ functions require prototypes that specify the return type and parameters. Function overloading allows multiple functions to have the same name but different signatures. Default arguments allow functions to be called without providing trailing arguments. Inline functions expand the function body at the call site for small functions to reduce overhead compared to regular function calls.
This document discusses abstract classes in C++. It defines an abstract class as a class designed to be used as a base class that cannot be instantiated and must contain at least one pure virtual function. It provides an example of how to declare an abstract class with a pure virtual function and how to derive a class from an abstract class, overriding the pure virtual functions. The importance of abstract classes is that they allow common functionality to be defined for derived classes while leaving implementation details to the derived classes.
Control structures in C++ affect how statements are executed and include sequence, selection, and loop structures. Sequence structures execute statements sequentially, selection structures choose between alternatives using if, if/else, and switch statements, and loop structures repeat statements using do-while, while, and for loops. Common control structures are used to make decisions, repeat actions, and transfer control based on conditions.
This document discusses exception handling in C++. It defines an exception as an event that occurs during program execution that disrupts normal flow, like divide by zero errors. Exception handling allows the program to maintain normal flow even after errors by catching and handling exceptions. It describes the key parts of exception handling as finding problems, throwing exceptions, catching exceptions, and handling exceptions. The document provides examples of using try, catch, and throw blocks to handle exceptions in C++ code.
Constructors and destructors are special member functions in C++ that are used to initialize and cleanup objects. Constructors are called automatically when an object is created and are used to set initial values for object attributes. Destructors are called automatically when an object is destroyed and can perform cleanup tasks. There are different types of constructors like default, parameterized, and copy constructors. Destructors do not have parameters and are used to deallocate memory when objects are destroyed.
This document provides an introduction to the C programming language. It discusses key concepts such as data types, variables, constants, operators, statements and functions. It also explains basic C program structure and provides examples of simple C programs to add two numbers and print a message. The document is intended to teach basic C programming concepts to readers new to the language.
The document discusses the benefits of exercise for mental health. Regular physical activity can help reduce anxiety and depression and improve mood and cognitive functioning. Exercise causes chemical changes in the brain that may help protect against mental illness and improve symptoms.
ALOK TIWARI
Contact: +919685449288, +91758 – 2403566 /
E-Mail: aloktiwari81@gmail.com,alok_tiwari_81@yahoo.com
Dear Sir/ Madam,
Please find attached resume for the position. I'm particularly interested in the Job opportunity, My overall experience strongly speaks about main profile - Design Engineering ( Electrical Design – Power Transformers) / Project Engineering & Management with exposure in preparation of technical designs for Power Transformers & related activities /Getting engaged in pre-sales cross functional activities related to product manufacturing and development process/Methods & Techniques.
I believe I meet all the essential criteria with great potential and enthusiasm for the position, roles & responsibilities at the work place offered in the organization, highlighting overall experience and demonstrated talent:
Played a key role in the Tasks assigned for Product & Process development /Innovation.
Instrumental in handling the assignments related to IS/ANSI/IEC standards/Pre-Sales cross functional activities & Project engineering/Techno-Commercial calculations.
Efficiently shouldered the responsibilities of the coordinator for ISO 14001-ISO 18001 EMS & OHSAS/Project engineering for Power Transformers & cross functional activities/Process functions & Methods.
A keen communicator with honed Interpersonal/Problem solving/Cross functional/ Analytical & Task handling abilities.
I am looking forward to take up roles in Technical & Project Engineering Management domain in an organization. The particular interest would be global assignments related to Project engineering & management/ Design Engineering & Analysis /Technical Assignments.
I am keen to join a potential employer due to its leading position in the industry, great organizational culture, spirit of innovation, professionalism as mentioned & highlighted that characterizes an organization and its employees. I am attracted to this role on account of the great organizational values as understood & will provide me an opportunity to bring forward my skills to get more horizons that i think organization offers.
I appreciate you are taking time to review my credentials , exposure & experience. Hence looking forward for a positive response.
Thank you.
Sincerely,
Alok Tiwari
Enclosure: 1) CV. 2) Profile presentation.
Data abstraction is the process of hiding unnecessary implementation details and exposing only essential information to the user. It separates the interface from the implementation. In Python, data abstraction can be achieved through abstract classes, which cannot be instantiated directly but can be inherited. Abstract classes define a common API for subclasses and allow concrete methods to be implemented only once for all subclasses. Data abstraction improves flexibility, reusability, and makes working on large codebases with teams easier.
The document provides an overview of object-oriented programming concepts in .NET such as classes, objects, methods, constructors, destructors, inheritance, polymorphism, interfaces, access modifiers, and static members. It defines each concept and provides examples to illustrate how they are implemented in C#.
The document discusses modular programming, which involves separating a program into independent, interchangeable modules that each contain everything needed to execute one aspect of the desired functionality. Modular programming makes programs easier to understand, manage complexity through smaller blocks of code, encourage code re-use, and allow independent development of code. It provides an example program that defines a function to find the maximum of two numbers and calls that function from the main program. Advantages of modular programming include that modules can be written and tested separately, reused, and allow large projects to be developed in parallel.
1. Inheritance is a mechanism where a new class is derived from an existing class, known as the base or parent class. The derived class inherits properties and methods from the parent class.
2. There are 5 types of inheritance: single, multilevel, multiple, hierarchical, and hybrid. Multiple inheritance allows a class to inherit from more than one parent class.
3. Overriding allows a subclass to replace or extend a method defined in the parent class, while still calling the parent method using the super() function or parent class name. This allows the subclass to provide a specific implementation of a method.
This document provides an introduction to object-oriented programming concepts in C++ including objects, classes, encapsulation, inheritance, polymorphism, and more. It explains the basic structure of a C++ program and demonstrates how to write a simple "Hello World" program. It also covers basic C++ elements like variables, data types, comments, strings, arithmetic operators, and input/output.
Inheritance allows classes to establish a hierarchical relationship between base and derived classes so that the derived class can inherit attributes and behaviors from the base class. There are several types of inheritance including single, multilevel, and multiple inheritance. Visibility modes like public, private, and protected determine which members are inherited from the base class. Virtual base classes are used to resolve ambiguities that can arise from multiple inheritance hierarchies sharing a common base class.
Header files contain function and variable definitions that are imported into C++ programs using the #include statement. Header files have a ".h" extension and declare functions and define macros. When a function is used in a C++ program, its definition must be imported from the library by including the appropriate header file. Common header files provide input/output operations (iostream.h), console input/output (conio.h), formatted I/O (iomanip.h), strings (string.h), mathematics functions (math.h), general purpose functions like memory management (stdlib.h), and random number generation (stdlib.h).
C++ is an object-oriented programming language developed by Bjarne Stroustrup at Bell Labs as an extension of C with the addition of classes. A simple C++ program consists of including header files, defining classes and their functions, and a main function that uses the classes. The program demonstrates input using cin and output using cout to display the sum and average of two numbers entered by the user.
- A ref cursor is a variable that references the result of a cursor, allowing it to be passed between procedures and functions.
- Ref cursors can be weakly typed, where the returned data type is unknown, or strongly typed by defining the row type being returned.
- Examples show opening a ref cursor, passing it to other procedures to be processed, and closing the cursor once processing is complete. Ref cursor variables point to a single underlying cursor.
The document discusses different types of loops and conditional statements in programming languages. It explains the if, if-else, and switch conditional statements, providing examples of each. It also covers different types of loops - while, do-while, for, and nested loops. Examples are given to illustrate the syntax and usage of each loop and conditional statement.
A function is a group of statements that together perform a task. Every C program has at least one function, which is main(), and all the most trivial programs can define additional functions. You can divide up your code into separate functions.
C++ functions require prototypes that specify the return type and parameters. Function overloading allows multiple functions to have the same name but different signatures. Default arguments allow functions to be called without providing trailing arguments. Inline functions expand the function body at the call site for small functions to reduce overhead compared to regular function calls.
This document discusses abstract classes in C++. It defines an abstract class as a class designed to be used as a base class that cannot be instantiated and must contain at least one pure virtual function. It provides an example of how to declare an abstract class with a pure virtual function and how to derive a class from an abstract class, overriding the pure virtual functions. The importance of abstract classes is that they allow common functionality to be defined for derived classes while leaving implementation details to the derived classes.
Control structures in C++ affect how statements are executed and include sequence, selection, and loop structures. Sequence structures execute statements sequentially, selection structures choose between alternatives using if, if/else, and switch statements, and loop structures repeat statements using do-while, while, and for loops. Common control structures are used to make decisions, repeat actions, and transfer control based on conditions.
This document discusses exception handling in C++. It defines an exception as an event that occurs during program execution that disrupts normal flow, like divide by zero errors. Exception handling allows the program to maintain normal flow even after errors by catching and handling exceptions. It describes the key parts of exception handling as finding problems, throwing exceptions, catching exceptions, and handling exceptions. The document provides examples of using try, catch, and throw blocks to handle exceptions in C++ code.
Constructors and destructors are special member functions in C++ that are used to initialize and cleanup objects. Constructors are called automatically when an object is created and are used to set initial values for object attributes. Destructors are called automatically when an object is destroyed and can perform cleanup tasks. There are different types of constructors like default, parameterized, and copy constructors. Destructors do not have parameters and are used to deallocate memory when objects are destroyed.
This document provides an introduction to the C programming language. It discusses key concepts such as data types, variables, constants, operators, statements and functions. It also explains basic C program structure and provides examples of simple C programs to add two numbers and print a message. The document is intended to teach basic C programming concepts to readers new to the language.
The document discusses the benefits of exercise for mental health. Regular physical activity can help reduce anxiety and depression and improve mood and cognitive functioning. Exercise causes chemical changes in the brain that may help protect against mental illness and improve symptoms.
ALOK TIWARI
Contact: +919685449288, +91758 – 2403566 /
E-Mail: aloktiwari81@gmail.com,alok_tiwari_81@yahoo.com
Dear Sir/ Madam,
Please find attached resume for the position. I'm particularly interested in the Job opportunity, My overall experience strongly speaks about main profile - Design Engineering ( Electrical Design – Power Transformers) / Project Engineering & Management with exposure in preparation of technical designs for Power Transformers & related activities /Getting engaged in pre-sales cross functional activities related to product manufacturing and development process/Methods & Techniques.
I believe I meet all the essential criteria with great potential and enthusiasm for the position, roles & responsibilities at the work place offered in the organization, highlighting overall experience and demonstrated talent:
Played a key role in the Tasks assigned for Product & Process development /Innovation.
Instrumental in handling the assignments related to IS/ANSI/IEC standards/Pre-Sales cross functional activities & Project engineering/Techno-Commercial calculations.
Efficiently shouldered the responsibilities of the coordinator for ISO 14001-ISO 18001 EMS & OHSAS/Project engineering for Power Transformers & cross functional activities/Process functions & Methods.
A keen communicator with honed Interpersonal/Problem solving/Cross functional/ Analytical & Task handling abilities.
I am looking forward to take up roles in Technical & Project Engineering Management domain in an organization. The particular interest would be global assignments related to Project engineering & management/ Design Engineering & Analysis /Technical Assignments.
I am keen to join a potential employer due to its leading position in the industry, great organizational culture, spirit of innovation, professionalism as mentioned & highlighted that characterizes an organization and its employees. I am attracted to this role on account of the great organizational values as understood & will provide me an opportunity to bring forward my skills to get more horizons that i think organization offers.
I appreciate you are taking time to review my credentials , exposure & experience. Hence looking forward for a positive response.
Thank you.
Sincerely,
Alok Tiwari
Enclosure: 1) CV. 2) Profile presentation.
The document discusses a seminar presentation on January 11th about the first screens of an interactive workbook app. It also mentions a video being made about the app. The seminar presentation showed the initial screens of a new interactive workbook app and provided a look at a video that is being created about the app.
Kristian Norling of Intranätverk (Sweden). While improvements in search require both resources and thorough reviews, there are some things you can do to start the journey. A a crash-course in intranet search with five actionable to-dos to take home. (5 mins.)
1) O documento discute os termos essenciais e integrantes da oração, incluindo sujeito, predicado, objeto direto e indireto.
2) É explicado que o sujeito é o termo sobre o qual se declara algo no predicado.
3) São descritos diferentes tipos de sujeito como simples, desinencial, composto e indeterminado.
Este documento discute a sintaxe da língua portuguesa segundo a gramática normativa. Apresenta os tipos de predicado, incluindo predicado verbal, nominal e verbonominal. Também explica os verbos de ligação e ação, como verbos transitivos e intransitivos, e os diferentes tipos de objetos na oração, como objetos diretos, indiretos e preposicionados. O objetivo é fornecer os termos essenciais para a análise sintática do período simples.
Teks tersebut membahas sejarah perkembangan keperawatan dari zaman purba hingga modern di berbagai negara termasuk Indonesia. Mulai dari zaman purba, keperawatan dipengaruhi kepercayaan agama dan berkembang pesat pada zaman Islam. Di zaman modern, Florence Nightingale memperkenalkan pendidikan formal untuk perawat dan mendirikan sekolah perawatan. Di Indonesia, keperawatan berkembang sejak masa kolonial hingga merdeka.
1) O documento descreve o diálogo entre Inês e Lianor Vaz, onde Lianor convence Inês a se casar com Pero Marques por sua riqueza e ingenuidade.
2) Detalha o casamento de Inês e Pero Marques, com Pero prometendo dedicar-se a Inês e dar-lhe liberdade, enquanto Lianor organiza o casamento rapidamente.
3) Discutem a traição de Inês com o Ermitão, com Inês se divertindo à custa de Pero Marques, que é ingênuo e facilmente enganado
Este documento resume as Cantigas de Amigo, canções líricas portuguesas da Idade Média. As cantigas falam de uma relação amorosa ausente entre uma donzela e seu amado. São simples e rurais, expressando a saudade da mulher pelo seu amigo distante através de refrões e personagens como a mãe e as amigas.
O documento descreve a história e cultura da Grécia antiga. A Grécia era composta por diversas cidades-estado independentes chamadas de pólis, como Atenas e Esparta. O documento detalha os principais períodos históricos da Grécia, incluindo o período homérico, arcaico, clássico e helenístico, além de aspectos como a religião, filosofia, teatro e política nas pólis gregas.
O documento descreve a história de Roma, sua sociedade e economia, a expansão do cristianismo no Império Romano e a queda deste. Também aborda a formação da Europa medieval, com a fusão de elementos romanos e germânicos e o surgimento do feudalismo.
Este documento presenta los resultados clave de un estudio sobre el consumo de audio online en España realizado en 2017. Algunos hallazgos clave son: 1) el 50% de los internautas españoles consumen audio online, 2) los formatos más populares son la radio online en directo y música a la carta, y 3) aunque la mayoría encuentra razonable la cantidad de publicidad, más de la mitad siente que les interrumpe durante el consumo. El estudio también analiza los perfiles de los oyentes, sus hábitos y su disposición a pagar por contenidos
O documento discute os conceitos de EBD, comparando o que é e não é considerado EBD. Ele lista vários termos como "revista", "filosofia", "partidos", "professor" e "terapia", indicando se cada um se enquadra ou não na definição de EBD.
Para conhecermos bem uma pessoa, temos que ter proximidade com ela. Chegarmos de mansinho, cada vez mais perto, ouvir a sua história, suas palavras, tocá-la de perto. Assim, vamos nos aproximar mais do Apóstolo Paulo, ele quer se revelar a nós hoje e tem “um dom espiritual para nos comunicar” (Rm 1,11).
Há três formas de conhecermos Paulo, através dos Atos dos Apóstolos, das suas cartas e por meio da Tradição Cristã.
O próprio apóstolo traça sua biografia
The document discusses inheritance in C++. It defines inheritance as creating new classes from existing classes where the new classes inherit properties of the existing classes. There are different types of inheritance including single, multiple, hierarchical and multilevel inheritance. The relationship between base and derived classes is described. Access specifiers like public, private and protected are also discussed which determine how members of base classes can be accessed in derived classes. Examples of code implementing single inheritance between two classes are provided.
The document discusses different types of inheritance in C++ including single, multiple, hierarchical, and multilevel inheritance. Single inheritance involves one base class and derived class. Multiple inheritance allows a class to inherit from multiple base classes. Hierarchical inheritance uses a single base class to derive multiple classes. Multilevel inheritance involves a derived class acting as a base class to further derived classes. Examples of code implementing these inheritance types are provided.
The genetic characters transmitted from parent to offspring, taken collectively.
Something, as a quality, characteristic, or other immaterial possession, received from progenitors or predecessors as if by succession.
↓↓↓↓ Read More:
@ Kindly Follow my Instagram Page to discuss about your mental health problems-
-----> https://instagram.com/mentality_streak?utm_medium=copy_link
@ Appreciate my work:
-----> behance.net/burhanahmed1
Thank-you !
This document discusses object-oriented programming (OOP) concepts like classes, objects, inheritance, encapsulation, abstraction, and polymorphism in C++. It provides examples of how each concept is implemented in C++. It explains that classes are user-defined data types that contain data fields and methods. Objects are instances of classes. Inheritance allows classes to inherit attributes from other classes. Encapsulation binds data to the methods that operate on it. Abstraction hides unnecessary details and displays only essential information. Polymorphism allows one message to have multiple implementations.
Inheritance allows classes to inherit properties from other classes, making code reuse and maintenance easier. There are several types of inheritance in C++. Public inheritance allows derived classes to access public and protected members of the base class. Protected inheritance makes public and protected base class members protected in derived classes. Private inheritance makes public and protected base members private in derived classes. Common inheritance types include single inheritance, multilevel inheritance, multiple inheritance, hierarchical inheritance, and hybrid inheritance.
The document discusses various concepts related to inheritance in C++ including types of inheritance (single, multiple, hierarchical, multilevel, hybrid), defining derived classes, visibility modes (private, public), constructors and destructors in derived classes, virtual base classes, virtual functions, pure virtual functions, and abstract base classes. It provides examples and explanations for each concept.
Inheritance allows one class to acquire the properties and behaviors of another class, known as the base or parent class, allowing code reuse and extension of existing classes without modification. There are different types of inheritance like simple, multilevel, and multiple inheritance that build upon the base class in various ways. Inheritance provides benefits like code reuse, extension of existing classes, and ability to override methods of the base class in the derived class.
1. The document introduces classes, explaining concepts like data hiding, abstraction, and encapsulation. It defines a class as a way to bind data and associated functions together to represent real-world entities.
2. A class has four attributes - data members to describe characteristics, member functions for behaviors, an access level to control access, and a class name used to create objects. An example class Account is given with attributes like account number, type, balance and functions like deposit and withdraw.
3. Objects are instances of a class that allow manipulating the data and calling the functions of the class. Some examples of class objects are given.
Access Specifiers
Derived Classes
Type of Inheritance
Derived class Constructors (Constructors in single Inheritance)
Multiple Inheritance
Constructors in multiple Inheritance
Constructors in single/multiple Inheritance with arguments.
Inheritance is the second most important feature of OOP.
In inheritance, the code of existing classes is used for making new classes.
This saves time for writing and debugging the entire code for a new class.
To inherit means to receive.
In inheritance a new class is written such that it can access or use the members of an existing class.
The new class that can access the members of an existing class is called the derived class or child class. The existing class is called the base class or parent class.
Abbasajmal
03149958500
The document provides information about object-oriented programming concepts in C++ including class, object, constructor, destructor, access specifiers, data members, member functions, static members, and friend functions. It defines each concept, provides syntax examples, and explains how to create a class, make objects, and access members. Constructors are used to initialize objects while destructors deallocate memory. Access specifiers determine public, private, and protected access.
The document discusses structures and classes in C++. It defines a structure called student with data members like name and roll number. It then defines a class called person with data members name and number and demonstrates creating an object of the class and accessing its members. The document also discusses concepts like defining member functions inside and outside classes, access specifiers, nesting member functions, and making outside member functions inline.
Inheritance allows reuse of properties and behaviors of an existing class when creating new classes. The existing class is called the base/parent class, while the new class is the derived/child class. The child class inherits all properties and behaviors of the parent class and can define additional properties and behaviors of its own. There are different types of inheritance like single, multilevel, multiple and hierarchical inheritance which define how properties and behaviors are inherited between parent and child classes.
Access controlaspecifier and visibilty modesVinay Kumar
Access modifiers in C++ allow restricting access to classes, members, and inherited members. The three main access modifiers are public, private, and protected. Public members can be accessed anywhere, private members only within the class, and protected members within the class and subclasses. The scope resolution operator :: is used to access members when names are hidden, define functions outside classes, access static members, and resolve multiple inheritance conflicts.
The document discusses object-oriented programming concepts like inheritance, base classes, derived classes, and access specifiers. It defines inheritance as enabling the creation of generalized classes that more specialized derived classes can extend from, establishing an "is-a" relationship. It also explains how access specifiers like public, private, and protected determine whether members of a base class are accessible to its derived classes.
The document discusses object-oriented programming concepts like inheritance, base classes, derived classes, and access specifiers. It defines inheritance as enabling the creation of generalized classes that more specialized derived classes can extend from, establishing an "is-a" relationship. It also explains how access specifiers like public, private, and protected determine whether members of a base class are accessible to its derived classes.
Inheritance allows classes to inherit characteristics from other classes. There are three types of inheritance: public, protected, and private. Public inheritance makes base class members public or protected in the derived class. Protected inheritance makes base class members protected in the derived class. Private inheritance makes base class members private in the derived class. Polymorphism allows functions to have different implementations depending on the type of object that calls it. Virtual functions provide polymorphism by allowing derived classes to override base class function implementations through late binding.
The document discusses key concepts in class definitions in VB.Net including class structure with attributes, access modifiers, and inheritance indicators. It also covers class members like functions and encapsulation. Constructors and destructors are described as special member functions. Inheritance allows one class to inherit properties from another base class.
This document discusses object-oriented programming concepts in C++ including classes, objects, constructors, destructors, and friend functions. It begins by explaining that classes are abstract data types that contain data members and member functions. It then provides examples of declaring a class, creating objects, and accessing class members. It also covers topics like static class members, arrays of objects, constructor and destructor definitions and uses, and declaring friend functions to allow non-member functions access to private class members.
C++ inheritance allows one class to inherit attributes and behaviors from another class. The class that inherits is called the derived class, while the class being inherited from is called the base class. Inheritance promotes code reuse and helps with program design. The key advantages are that derived classes can reuse code from the base class without redefining members, and class libraries can be easily built and distributed by deriving new classes from existing ones. C++ supports various types of inheritance including single, multiple, hierarchical and multilevel inheritance.
This document provides an introduction to classes and objects in C++. It defines key concepts like class, object, member functions, access specifiers, and arrays of objects. It also discusses defining objects of a class, accessing class members, passing objects as function arguments, and the differences between classes and structures in C++.
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slackshyamraj55
Discover the seamless integration of RPA (Robotic Process Automation), COMPOSER, and APM with AWS IDP enhanced with Slack notifications. Explore how these technologies converge to streamline workflows, optimize performance, and ensure secure access, all while leveraging the power of AWS IDP and real-time communication via Slack notifications.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
Programming Foundation Models with DSPy - Meetup SlidesZilliz
Prompting language models is hard, while programming language models is easy. In this talk, I will discuss the state-of-the-art framework DSPy for programming foundation models with its powerful optimizers and runtime constraint system.
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
Infrastructure Challenges in Scaling RAG with Custom AI modelsZilliz
Building Retrieval-Augmented Generation (RAG) systems with open-source and custom AI models is a complex task. This talk explores the challenges in productionizing RAG systems, including retrieval performance, response synthesis, and evaluation. We’ll discuss how to leverage open-source models like text embeddings, language models, and custom fine-tuned models to enhance RAG performance. Additionally, we’ll cover how BentoML can help orchestrate and scale these AI components efficiently, ensuring seamless deployment and management of RAG systems in the cloud.
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/building-and-scaling-ai-applications-with-the-nx-ai-manager-a-presentation-from-network-optix/
Robin van Emden, Senior Director of Data Science at Network Optix, presents the “Building and Scaling AI Applications with the Nx AI Manager,” tutorial at the May 2024 Embedded Vision Summit.
In this presentation, van Emden covers the basics of scaling edge AI solutions using the Nx tool kit. He emphasizes the process of developing AI models and deploying them globally. He also showcases the conversion of AI models and the creation of effective edge AI pipelines, with a focus on pre-processing, model conversion, selecting the appropriate inference engine for the target hardware and post-processing.
van Emden shows how Nx can simplify the developer’s life and facilitate a rapid transition from concept to production-ready applications.He provides valuable insights into developing scalable and efficient edge AI solutions, with a strong focus on practical implementation.
Driving Business Innovation: Latest Generative AI Advancements & Success StorySafe Software
Are you ready to revolutionize how you handle data? Join us for a webinar where we’ll bring you up to speed with the latest advancements in Generative AI technology and discover how leveraging FME with tools from giants like Google Gemini, Amazon, and Microsoft OpenAI can supercharge your workflow efficiency.
During the hour, we’ll take you through:
Guest Speaker Segment with Hannah Barrington: Dive into the world of dynamic real estate marketing with Hannah, the Marketing Manager at Workspace Group. Hear firsthand how their team generates engaging descriptions for thousands of office units by integrating diverse data sources—from PDF floorplans to web pages—using FME transformers, like OpenAIVisionConnector and AnthropicVisionConnector. This use case will show you how GenAI can streamline content creation for marketing across the board.
Ollama Use Case: Learn how Scenario Specialist Dmitri Bagh has utilized Ollama within FME to input data, create custom models, and enhance security protocols. This segment will include demos to illustrate the full capabilities of FME in AI-driven processes.
Custom AI Models: Discover how to leverage FME to build personalized AI models using your data. Whether it’s populating a model with local data for added security or integrating public AI tools, find out how FME facilitates a versatile and secure approach to AI.
We’ll wrap up with a live Q&A session where you can engage with our experts on your specific use cases, and learn more about optimizing your data workflows with AI.
This webinar is ideal for professionals seeking to harness the power of AI within their data management systems while ensuring high levels of customization and security. Whether you're a novice or an expert, gain actionable insights and strategies to elevate your data processes. Join us to see how FME and AI can revolutionize how you work with data!
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!SOFTTECHHUB
As the digital landscape continually evolves, operating systems play a critical role in shaping user experiences and productivity. The launch of Nitrux Linux 3.5.0 marks a significant milestone, offering a robust alternative to traditional systems such as Windows 11. This article delves into the essence of Nitrux Linux 3.5.0, exploring its unique features, advantages, and how it stands as a compelling choice for both casual users and tech enthusiasts.
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-und-domino-lizenzkostenreduzierung-in-der-welt-von-dlau/
DLAU und die Lizenzen nach dem CCB- und CCX-Modell sind für viele in der HCL-Community seit letztem Jahr ein heißes Thema. Als Notes- oder Domino-Kunde haben Sie vielleicht mit unerwartet hohen Benutzerzahlen und Lizenzgebühren zu kämpfen. Sie fragen sich vielleicht, wie diese neue Art der Lizenzierung funktioniert und welchen Nutzen sie Ihnen bringt. Vor allem wollen Sie sicherlich Ihr Budget einhalten und Kosten sparen, wo immer möglich. Das verstehen wir und wir möchten Ihnen dabei helfen!
Wir erklären Ihnen, wie Sie häufige Konfigurationsprobleme lösen können, die dazu führen können, dass mehr Benutzer gezählt werden als nötig, und wie Sie überflüssige oder ungenutzte Konten identifizieren und entfernen können, um Geld zu sparen. Es gibt auch einige Ansätze, die zu unnötigen Ausgaben führen können, z. B. wenn ein Personendokument anstelle eines Mail-Ins für geteilte Mailboxen verwendet wird. Wir zeigen Ihnen solche Fälle und deren Lösungen. Und natürlich erklären wir Ihnen das neue Lizenzmodell.
Nehmen Sie an diesem Webinar teil, bei dem HCL-Ambassador Marc Thomas und Gastredner Franz Walder Ihnen diese neue Welt näherbringen. Es vermittelt Ihnen die Tools und das Know-how, um den Überblick zu bewahren. Sie werden in der Lage sein, Ihre Kosten durch eine optimierte Domino-Konfiguration zu reduzieren und auch in Zukunft gering zu halten.
Diese Themen werden behandelt
- Reduzierung der Lizenzkosten durch Auffinden und Beheben von Fehlkonfigurationen und überflüssigen Konten
- Wie funktionieren CCB- und CCX-Lizenzen wirklich?
- Verstehen des DLAU-Tools und wie man es am besten nutzt
- Tipps für häufige Problembereiche, wie z. B. Team-Postfächer, Funktions-/Testbenutzer usw.
- Praxisbeispiele und Best Practices zum sofortigen Umsetzen
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
inheritance
1. Contents
Access Specifiers
Derived Classes
Type of Inheritance
Derived class Constructors (Constructors in single
Inheritance)
Multiple Inheritance
Constructors in multiple Inheritance
Constructors in single/multiple Inheritance with
arguments.
2. Inheritance
Inheritance is the second most important feature of OOP.
In inheritance, the code of existing classes is used for making new classes.
This saves time for writing and debugging the entire code for a new class.
To inherit means to receive.
In inheritance a new class is written such that it can access or use the members of
an existing class.
The new class that can access the members of an existing class is called the derived
class or child class. The existing class is called the base class or parent class.
3. Inheritance
The derived class can use the data members and member functions of the
base class.
It can also have its own data members and member functions.
Thus a derived class can even be larger than a base class.
4. Inheritance
The figure shows the relationship
between a derived class and the base
class.
The arrow is drawn from the derived
class to the base class.
The direction of the arrow indicates
that the derived class can access
members of the base class but base
class cannot access members of its
derived class.
In the figure shown on the left, the
derived class has only one member of
its own. The two members shown in
dotted lines are the members of the
base class. The derived class can also
access these two members of the base
class. Thus, whereas an object of the
base class can access only two
members, an object of the derived
class can access three members. A
new class can be derived from one or
more existing Classes.
5. Specifiers
Public [Already Discussed]
Private [Already Discussed]
Protected
The public members of a class are accessible by all functions in the program and
the private members of a class are accessible only by member functions and friend
functions of that class. Similarly, the protected members of a class are accessible
by the member functions and friend functions of that Class.
The protected members of a base class are, however, accessible by members of its
derived classes but the private members of the base class are not accessible
directly by members of its derived classes. This is the main difference between the
protected and the private access specifiers.
The protected members of a base class fall between private and public member.
These members are public for the derived class but for the rest of the program,
these are treated as private.
6. Defining Derived Class
The syntax for defining a derived class is slightly different from the syntax of the
base class definition. The declaration of a derived class also includes the name
of the base class from which it is derived. The general syntax for defining a
derived class is:
class sub_class_name : specifier
base_class_name{ ………………………………….
members of derived class
………………………………………}
Where
sub_class_name : represents name of the derived class.
: (colon) sets relation between the classes.
specifier represents the access specifier. It may be public, private or
Protected, base_class_name : represents name of the base class.
7. For example, a class "student" is
defined as:
class student {
private: Char name[15], address[15];
public:
void input (void);
void show(void);
};
8. Example Explanation
The class student has two data members and two member
functions. Suppose the marks obtained by a student in three
different subjects and the total marks of these subjects are to
be included as new data members in the above class. This is
done by adding new members in the class. There are two ways
in which these new members can be added to the class:
• Add new members in the original
• Define a new class that has the new members and that also
uses members of the existing "student" class. Using the
members of an existing class is the principle of inheritance.
The new class is the derived class. The existing class serves as
the base class for the derived class.
9. Defining Derived Class (cont…)
Driving a new class from the existing class reduces the size of the
program. It also eliminates duplication of code within the
program. For example, let the name of the new class be marks.
This class uses the members of the existing student class.
class marks : public student {
private:
int s1,s2,s3, total;
public:
void inputmarks(void);
void show_detail(void); };
10. Defining Derived Class (cont..)
The cIass marks is derived from the class student. The class marks is the
derived class. The class student is the base class.
The derived class has four data members of integer type and two member
functions.
It also uses the code of the base class student.
The derived class cannot directly access the private data members the base
class student by using the dot operator.
These members are only accessible to the derived class through the
interface functions within the base class.
11. Types of Inheritance
There are three kinds of inheritance.
• Public • Private • Protected
Public Inheritance
In Public Inheritance, the public members of the base class
become the public members of the derived class.
Thus the objects of the derived class can access public
members (both data and functions) of the base class.
Similarly, the protected data members of the base class also
become the protected members of derived class.
12. The general syntax for deriving a public class
from base class is:
class sub_class_name : public base_class_name {
…………………
…………………
) ;
where
public: specifies the public inheritance.
sub_class__name: represents name of the derived class.
base_class_name: represents name of the base class.
13. Example: Public Inheritance
#include<iostream>
using namespace std;
class A {
private:
int a1,a2;
protected:
int pa1,pa2;
public:
void ppp (void){
cout<<"Value of pal of class
A="<<pa1<<endl;
cout<<"Value of pa2 of class
A="<<pa2<<endl; }};
class B : public A {
public:
void get(void){
cout << "Enter value pal ? ";
cin>>pa1;
cout<<"Enter value pa2 ?";
cin>>pa2;}};
main (){
B ob;
ob.get();
ob.ppp();
};
14. Example Explanation
In the above program the class B is publicly derived from class
A. The object of the class B
Cannot access the private data member’s a1 & a2 of base class
A.
Can access the public function member ppp of base class A.
Can access the protected data members pa1 & pa2 of base
class A.
15. Private Inheritance
In private Inheritance the objects of the derived class cannot
access the public members of the base class. Its objects can only
access the protected data members of the base class.
The general syntax for deriving private class from base class is:
class sub_class_name : private base_class_name {
………………………………….}
Private: specifies private inheritance.
sub_class_name: represents name of the derived class.
base_class_name: represents name of the base class.
16. Example: Private Inheritance
#include<iostream>
using namespace std;
class A {
private:
int a1,a2;
protected:
int pa1,pa2;
public:
void ppp (void){
cout<<"Value of pa1 of class
A="<<pa1<<endl;
cout<<"Value of pa2 of class
A="<<pa2<<endl;}
};
class B : private A
{ public:
void get(void)
{cout<<"Enter value of pa1 ";
cin>>pa1;
cout<<"Enter value of pa2 =";
cin>>pa2;
cout<<"Value of pa1 of class
A="<<pa1<<endl;
cout<<"Value of pa2 of class
A="<<pa2<<endl;}};
main ( ){
B ob;
ob.get(); }
17. Example Explanation
In the above program, the class B is derived as private for the
base class A. The objects of class B:
cannot access the private data members a1 & a2 of base class
A.
cannot access the public function member ppp of base class A.
can only access the protected data members pal & pa2 of base
class A.
18. Protected Inheritance
The object of the class that is derived as protected can access
only the protected member of the base class. The general syntax
for deriving a protected Class from base class is:
class sub_class_name: protected base_class_name {
…………………
…………………
};
where protected: specifies protected inheritance.
sub_class_name: represents name of the derived class.
Base_class_name: represents name of the base class.
19. Example: Protected Inheritance
#include<iostream>
using namespace std;
class A
{
private :
int a1,a2;
protected:
int pa1,pa2;
public:
void get(void){
cout<<"value of pa1 of class A ";
cout<<"value of pa2 of class A ?";}};
class B: protected A{
public:
void get (void){
cout<<" Enter value of pa1=";
cin>>pa1;
cout<<"Value of pa2";
cin>>pa2;
cout<<"Value of pa1 of class
A="<<pa1<<endl;
cout<<"Value of pa2 of class
A="<<pa2<<endl;}};
main(){
B ob;
ob.get(); }
20. Example Explanation
In the above program, thc class B is derived as protected from the
base class A. The objects of class B:
can only access the protected data members pal &.pa2 of base
class A.
21. Derived Class Constructors
In inheritance, a constructor of the derived class as well the
constructor functions of the base class are automatically
executed when an object of the derived class is created.
The following example explains the concept of constructor
functions in single inheritance.
22. Example: Derived Class Constructors
#include<iostream>
using namespace std;
class bb{
public:
bb(void){
cout<<"Constructor of
base class"<<endl;
}
};
class dd:public bb{
public:
dd(void){
cout<<"Constructor of
derived class"<<endl;
}
};
main(){
dd abc;
}
23. Example Explanation
In the above program, when an object of the derived class dd
is created, the constructors of both the derived class as well as
the base class are executed.
24.
Multiple Inheritance
In Multiple inheritances, a class is derived by using more than
one classes.
In multiple inheritance the derived class receives the members
of two or more base classes.
Multiple inheritance is a powerful feature of Object Oriented
Programming.
This technique reduces the program size and save
programmer's. time. The programmer uses the existing base
classes in the program coding to solve problems.
The figure shown below illustrates the relation of derived class
with base classes.
26.
Multiple Inheritance
In the figure, Class C is derived from two base classes A & B. The syntax of
multiple inheritance is similar to that of single inheritance class. The name of
base classes are written separated by comma(,).
Syntax:
Class sub_class : sp1 b_class_1, sp2 b_class_2……..
{
………………………..
};
Where :
sp1 represents the access specifier of the first base class.
sp2 represents the access specifier of the second base class.
27. Example: Multiple Inheritance
#include<iostream>
using namespace std;
class student {
private:
char name[20],address[20];
public:
void input (void){
cout<<"Enter name:";cin>>name;
cout<<"Enter address:";cin>>address;
}
void print(void){
cout<<"Name:"<<name<<endl;
cout<<"Address:"<<address<<endl;
}
};
class marks {
private:
int s1,s2,total;
public:
void inputmarks(void){
cout<<"Enter marks of
S1=";cin>>s1;
cout<<"Enter marks of
S2=";cin>>s2;
total=s1+s2;}
void showmarks(void){
cout<<"Marks in s1="<<s1<<endl;
28. Example: Multiple Inheritance (Cont..)
cout<<"Marks in
s2="<<s2<<endl;
cout<<"Total
Marks="<<total<<endl;
}
};
class show: public student,
public marks{
public:
void showrec(){
cout<<"Record is"<<endl;
print();
showmarks();
}
};
main(){
show m;
m.input();
m.inputmarks();
m.showrec();
}
29. Constructor in Multiple Inheritance
When a class is derived from more than one base classes, the constructor of
the derived class as well as all of its base classes are executed when an
object of the derived class is created.
If the constructor functions have no parameters then first the constructor
functions of the base class are executed and then the constructor functions
of the derived class is executed.
30. Example: Constructor in Multiple Inheritance
#include<iostream>
using namespace std;
class aa{
public:
aa(){
cout<<"Class aa"<<endl;
}
};
class bb{
public:
bb(){
cout<<"Class bb"<<endl;
};
class cc:public aa,public bb{
public:
cc(){
cout<<"Class cc"<<endl;
}
};
main(){
cc o;
}
31. Example Explanation
In the above program, three classes are created.
The cc class is publicly derived from two class aa and bb.
All the classes have constructor functions are executed in the
following sequence.
1. Constructor of class aa is executed first.
2. Constructor of class bb is executed second.
3. Constructor of class cc is executed last.