C# Programming - Inheritance - Discussion

Discussion Forum : Inheritance - True or False (Q.No. 13)
It is illegal to make objects of one class as members of another class.
Answer: Option
No answer description is available. Let's discuss.
3 comments Page 1 of 1.

Sanjeev kumar verma said:   8 years ago
This is wrong answer.

We can have a member variable of type string.

And as we know string itself is object of string class.

class A

public string a; // a object as an member of class A
a= new String() // Object of string class as member of call A
Basically aggregation and Has-A relationship depends on it.

Anshul jain said:   9 years ago
Any one explain?

Kapil Hedaoo said:   9 years ago
Please explain with an example.

Post your comments here:

Your comments will be displayed after verification.