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 ? | 11 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 |
what does exactly the linker do?
What is the difference between const int *ptr and int const *ptr???
What are the benefits of oop?
Explain the concepts involved in Object Oriented programming.
What is the difference between pass by reference and pass by value?
How to calculate the age from the date of birth by using the program?
I have One image (means a group photo ) how to split the faces only from the image?............ please send the answer nagadurgaraju@gmail.com thanks in advace...
What is oops and its features?
What are the main differences between procedure oriented languages and object oriented languages?
9 Answers IBM, Infosys, Wipro,
Explain virtual inheritance?
what is the advantage in software? what is the difference between the software developer and Engineer
Name an advantage of linked list over array?