if (task1 != null)
//Do something with task1
else
{
if (task2 != null)
//Do something with task2
else
{
if (task3 != null)
//Do something with task3
else
{
if (task4 != null)
//Do something with task4
}
}
}
上記のコードに代わるものはありますか? null でないタスクに応じて、一種の「フラット」なスイッチ ケースを探しています。
助けていただける方には、事前にたくさんの感謝を申し上げます。