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

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

Can we override main method?

1120


What is pointer in oop?

967


What is encapsulation in oop?

987


Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box

2547


What is difference between abstraction and encapsulation?

1018


Why is abstraction used?

1023


What is use of overloading?

1078


What is the purpose of enum?

962


String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?

2332


Why is static class not inherited?

1040


Why do we use polymorphism in oops?

981


What is an advantage of polymorphism?

1029


Why is it so that we can have virtual constructors but we cannot have virtual destructors?

4802


What are oops methods?

944


What is an example of genetic polymorphism?

1116