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

后端 未结 9 1125
隐瞒了意图╮
隐瞒了意图╮ 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:38

    1. It's a self documenting feature.
    2. It's a way to make it possible to name a method "Class1" in some other class

提交回复
热议问题