Is passing null in to a method acceptable

前端 未结 5 2070
夕颜
夕颜 2021-01-02 16:03

Null is an odd data type for me, it seems as though it is wrong to ever use, maybe its the null pointer errors i got so often as a beginner that now have me associating any

5条回答
  •  独厮守ぢ
    2021-01-02 16:26

    That is perfectly acceptable. If you are using C# 4.0 you can also make the parameter optional so that the caller doesn't need to specify the default value.

提交回复
热议问题