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 / praveen

public class A
{
class B *b;
}
public class B
{
class A a;
}

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you achieve polymorphism?

618


assume the program must insert 4 elements from the key board and then do the following programs.sequential search(search one of the elements),using insertion sort(sort the element) and using selection sort(sort the element).

1671


write a program that takes input in digits and display the result in words from 1 to 1000

1992


What is encapsulation with real life example?

572


What is destructor in oop?

625






What is abstraction example?

624


What is pure oop?

599


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

3557


hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.

1544


write string class as your own class in java without using any built-in function

1978


What is polymorphism what are the different types of polymorphism?

566


What is polymorphism what is it for and how is it used?

576


What is encapsulation with example?

582


Can abstract class have normal methods?

616


write a C++ program for booking using constructor and destructor.

2055