I am a noob in oop as well as in C#. Consider A scenario in OO case like the following:
Package A
public class A {
constructor a(){
B b = new B(); // I want to instantiate `b` when i have instantiated `a`
// and i want to work with each `b` against each `a`
// is this the way to do that??**and assume classA inherits
// something else.
}
}
public class B
{}
Package B
using package A;
class M{
public main(){
A a = new A();
//how can i use `b` here ?
}
}
I have used pseudo code to outline some of the idea i want implement. But i dont know how do i do that. If its a wrong implementation or it can be done in a lot easier way, please show me how?