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

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.

1537


Write a program to reverse a string using recursive function?

1788


What is the renewal class?

2161


Is react oop?

607


what's the basic's in dot net

1736






What is overloading in oops?

596


Why is abstraction used?

603


Can we override main method?

603


When not to use object oriented programming?

567


What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?

2101


What is the real time example of encapsulation?

594


What is the difference between abstraction and polymorphism?

613


Can you explain polymorphism?

578


Write a program to sort the number with different sorts in one program ??

1914


Describe these concepts: Polymorphism, Inheritance and Abstraction.

610