C#与VB语言特性比较

C# VB 备注
类型名与成员名相同[1]Dan Bryant. Why can't C# member names be the same as the enclosing type name?. . 2010-11-02 [2019-08-26].
多行注释 使用多行注释符号可在版本控制系统中显示较少的修改。
多条件的for语句
三元条件运算符 a?b:c
null合并运算符a??1
null条件运算符a?.F()
在比较语句中赋值if((a=b)==null)
连续赋值int a,b;a = b = 1;
对Lambda表达式推断类型Dim x = Function(n As Integer) n + 1
方法参数的out、ref关键字声明数据流向

参考资料

. C#与Visual Basic .NET的比较. . [2019-08-26].

发表评论

电子邮件地址不会被公开。

:wink: :twisted: :roll: :oops: :mrgreen: :lol: :idea: :evil: :cry: :arrow: :?: :-| :-x :-o :-P :-D :-? :) :( :!: 8-O 8)