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?
Answer Posted / 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 |
Post New Answer View All Answers
Can we override main method?
What is the renewal class?
What is class and example?
What is polymorphism and why is it important?
What is the real life example of polymorphism?
why reinterpret cast is considered dangerous?
if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?
Give an example where we have to specifically use C programming language and C++ programming language cannot be used?
Whats is abstraction in oops?
Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.
How to hide the base class functionality in Inheritance?
What is a class in oop?
what is the 3 types of system development life cycle
Why is oop better than procedural?
What is balance factor?