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


Please Help Members By Posting Answers For Below Questions

Is react oop?

612


What are two types of polymorphism?

614


Advantage and disadvantage of routing in telecom sector

790


What is interface? When and where is it used?

1664


What is encapsulation and abstraction? How are they implemented in C++?

637






What is the real time example of inheritance?

645


What is the difference between abstraction and polymorphism?

619


Why is abstraction needed?

570


Why do pointers exist?

665


What is a class in oop?

607


what are the different types of qualifier in java?

1845


What does and I oop and sksksk mean?

654


What are the three parts of a simple empty class?

1462


What is meant by oops concept?

614


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.

1792