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.

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.

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

Anshul jain said:   9 years ago
Any one explain?

Post your comments here:

Your comments will be displayed after verification.