Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is stream in oop?

1298


How can you overcome the diamond problem in inheritance?

1179


What is inheritance and how many types of inheritance?

1100


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.

2193


Can you explain polymorphism?

1109


What are the data types in oop?

1096


design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)

6676


What is data binding in oops?

1091


How to call a non virtual function in the derived class by using base class pointer

6557


Who invented oop?

1126


Prepare me a program for the animation of train

2473


What is solid in oops?

1118


what type of question are asked in thoughtworks pair programming round ?

2211


Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)

4144


What is polymorphism give a real life example?

1032