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 |
write a c++ code of diagonal matrix.
class type to basic type conversion
4. What do you mean by a prototype? Define analysis prototype
INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?
write a program in c++ to overload the function add (s1,s2) where s1 and s2 are integers and floating point values.
What is the types of inheritance?
The company is a fake company asking for money of RS10000 while training and not offering a job after training. My humble request to you people not to attend Astersys interview
What is polymorphism explain its types?
What is multilevel inheritance explain with example?
what is SPL in c++.
I am developing a payroll system mini project.I used file concept in program for reading and writing.When the program is reloading into the memory that is if i execute next time the file was cleaned and adding data from the starting this is my problem.I want to strore the previous data and if i want to add any record that should be next of previous data.Please help me.
what is abstract class ? when is used in real time ? give a exp