What is the use of `default` keyword in C#?

前端 未结 6 656
盖世英雄少女心
盖世英雄少女心 2020-11-30 01:38
  1. What is the use of default keyword in C#?
  2. Is it introduced in C# 3.0 ?
6条回答
  •  被撕碎了的回忆
    2020-11-30 01:57

    Echoing and emphasizing it's use in generics and little else other than code-generation.

    If you have to initialize to default (already suspiciously smelly in my book) be clear. Just do it.

提交回复
热议问题