Why is C# statically typed?

前端 未结 17 2942
不思量自难忘°
不思量自难忘° 2020-12-01 05:07

I am a PHP web programmer who is trying to learn C#.

I would like to know why C# requires me to specify the data type when creating a variable.

Class         


        
17条回答
  •  难免孤独
    2020-12-01 05:59

    That's the difference between a strongly typed and weakly typed language. C# (and C, C++, Java, most more powerful languages) are strongly typed so you must declare the variable type.

提交回复
热议问题