C# Programming - Inheritance - Discussion

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

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

Anshul jain said:   8 years ago
Any one explain?

Sanjeev kumar verma said:   7 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.

Post your comments here:

Your comments will be displayed after verification.