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 ? | 12 Yes | 1 No |
Post New Answer View All Answers
What is stream in oop?
How can you overcome the diamond problem in inheritance?
What is inheritance and how many types of inheritance?
Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.
Can you explain polymorphism?
What are the data types in oop?
design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)
What is data binding in oops?
How to call a non virtual function in the derived class by using base class pointer
Who invented oop?
Prepare me a program for the animation of train
What is solid in oops?
what type of question are asked in thoughtworks pair programming round ?
Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)
What is polymorphism give a real life example?