Java program to create an object of a class as a data member in another class
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
In this program, we will create a Person class and then create a new class Employee, In the Employee class, we will create an object of Person class as a data member.
Program/Source Code:
The source code to create an object of a class as a data member in another class is given below. The given program is compiled and executed successfully.
Output: