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 |
What is an interface in oop?
how can we design a magic square in c++?or suggest me the basic idea of it.
How is polymorphism achieved?
What does enum stand for?
monkey starts climbing up a tree 20ft tall,each hour ,it hops 3ft and slips back by 2ft .how much time it wil tak to reach top of the tree?
what is data abstraction with example.
1. Wrie a function which returns the most frequent number in a list of integers. Handle the case of more than one number which meets this criterion. public static int[] GetFrequency(int[] list)
Please tell me the oops concept with detailed answer
What is polymorphism ? Explain with examples
What are generic functions and generic classes?
What is difference between #define and const?
What is object in oops?