C++ instance of same class [closed]
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 days ago . Improve this question I wondered whether it is possible in C++ to do the same stuff like in Java. That means something like this: public class A { private A a1; private A a2; A getA1(){ return a1; } A getA2(){ return a2; } void setA1(A a1){ this.a1 = a1; } void setA2(A a2){ this.a2 = a2; } } Now I