Why do C# and Java bother with the “new” operator?

后端 未结 9 1123
隐瞒了意图╮
隐瞒了意图╮ 2020-12-03 13:59

Why does the new operator exist in modern languages such as C# and Java? Is it purely a self documenting code feature, or does it serve any actual purpose?

For insta

9条回答
  •  無奈伤痛
    2020-12-03 14:45

    In addition to remarks above AFAIK they were planning to remove new keyword for Java 7 in early drafts. But later they cancelled it.

提交回复
热议问题