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?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / santhosh
class B;
public class A
{
B* b;
}
public class B
{
A a;
}
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / praveen
public class A
{
class B *b;
}
public class B
{
class A a;
}
| Is This Answer Correct ? | 0 Yes | 3 No |
Why is object oriented programming so hard?
why we call c++ is object oriented lanaguage
143.what is oops principles?
What is difference between #define and const?
WHAT IS THE DIFFERENCE BETWEEN OBJECT BASED & OBJECT ORIENTD PROGRAMMING LANGUAGE.(GIVE AT LIST 4 PIONT)
You attempt to query the data base with this command: SELECT name, salary FROM employee WHERE salary=(SELECT salary FROM employee WHERE last name='Wagner' OR dept no=233) Choose most appropriate option from the following: 1)Sub-queries are not allowed in the where clause. 2)a multiple row sub-query used with a single row comparison operator. 3)a single row query is used with a multiple row comparison operator.
what is polymorphism?
how to write a java program for an output ****0 ***01 **012 *0123 01234
What is the significance of classes in oop?
diff between Virtual mathod and abstract method?
What is the difference between XML Web Services using ASMX and .NET Remoting using SOAP?
c++ program to swap the objects of two different classes