B別のクラスの型のオブジェクトを初期化したいのですがA、なぜまだnullになるのですか?修飾子を使用refせずにそれを行うことは可能ですか?out
class A
{
public void Initialize(B value)
{
if (value == null)
{
value = new B();
}
}
}
class B
{
}
class Program
{
static void Main(string[] args)
{
A a = new A();
B b = null;
a.Initialize(b);
}
}
[upd。]クラスのインスタンスであるため、b変数を渡すことができると思いました。ref