Yes it can have, this is called self-referencing class.
Why it is not a compiler issue ?
Because you create a pointer to the object of same type, not the object.
This is frequently seen in C / C++ data structures like Linked List.
Yes it can have, this is called self-referencing class.
Why it is not a compiler issue ?
Because you create a pointer to the object of same type, not the object.
This is frequently seen in C / C++ data structures like Linked List.