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
by Forward declaring,
class B;
public class A
{
class B b;
}
public class B
{
class A a;
}
Is This Answer Correct ? | 11 Yes | 1 No |
Post New Answer View All Answers
What is abstract class in oop?
What is byval and byref? What are differences between them?
What is the full form of oops?
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).
Give two or more real cenario of virtual function and vertual object
What is polymorphism what is it for and how is it used?
write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.
What are two types of polymorphism?
What is encapsulation c#?
What is static in oop?
What are the 5 oop principles?
write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).
What is polymorphism in oops with example?
What are the three main types of variables?
What are benefits of oop?