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
Can we override main method?
What is pointer in oop?
What is encapsulation in oop?
Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box
What is difference between abstraction and encapsulation?
Why is abstraction used?
What is use of overloading?
What is the purpose of enum?
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?
Why is static class not inherited?
Why do we use polymorphism in oops?
What is an advantage of polymorphism?
Why is it so that we can have virtual constructors but we cannot have virtual destructors?
What are oops methods?
What is an example of genetic polymorphism?