【數組】
數組實例化,並賦值時,可以省略new[]。
int[] a=new [2]; --未賦值 int[] a={1,2}; --賦值
【對象】
對象實例化,並賦值時,可以省略()。
class test { public string name{get;set;} } test a=new test(); --未賦值 test a=new test{name="xiao"}; --賦值
【數組】
數組實例化,並賦值時,可以省略new[]。
int[] a=new [2]; --未賦值 int[] a={1,2}; --賦值
【對象】
對象實例化,並賦值時,可以省略()。
class test { public string name{get;set;} } test a=new test(); --未賦值 test a=new test{name="xiao"}; --賦值
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。