There are 2 classes defined as below
public class A
{
class B b;
}
public class B
{
class A a;
}
compiler gives error. How to fix it?
Answers were Sorted based on User's Feedback
Answer / santhosh
by Forward declaring,
class B;
public class A
{
class B b;
}
public class B
{
class A a;
}
| Is This Answer Correct ? | 12 Yes | 1 No |
Answer / santhosh
class B;
public class A
{
B* b;
}
public class B
{
A a;
}
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / praveen
public class A
{
class B *b;
}
public class B
{
class A a;
}
| Is This Answer Correct ? | 0 Yes | 3 No |
write a program to find 2^n+1 ?
What are the 5 oop principles?
how can we design a magic square in c++?or suggest me the basic idea of it.
what is main difference between object oriented object base
what are the characteristics of oops?
what are the disadvantages of C++?
25 Answers ATS, Infosys, UNI, Wipro,
What are functions in oop?
what are the ways in which a constructors can be called?
c++ program to swap the objects of two different classes
What normal C constructs work differently in C++?
Can you explain polymorphism?
what is the basic concept of inheritance?