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
class B;
public class A
{
B* b;
}
public class B
{
A a;
}
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
What is encapsulation in oops?
What are the 4 main oop principles?
Why interface is used?
What is a class and object?
What is the difference between static polymorphism and dynamic polymorphism?
What are the components of marker interface?
Are polymorphisms mutations?
Can bst contain duplicates?
Why is it so that we can have virtual constructors but we cannot have virtual destructors?
What is polymorphism what is it for and how is it used?
What are the data types in oop?
Whats oop mean?
What does sksksk mean in text slang?
What is the oops and benefits of oops programming?
IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?