可空类型:
int
?
a
=
null
;
int ? b =- 5 ;
int ? b =- 5 ;
比较可空类型时,只要一个操作数是null,比较的结果就是false。
C#组合类:
public
class
m
... {
public int add(int a,int b)
... {
return a+b;
}
}
public partial class m
.. {
public int subtract(int a, int b)
{
return a - b;
}
}
private void button2_Click( object sender, EventArgs e)
{
m s = new m();
s.add(1, 2);
}
... {
public int add(int a,int b)
... {
return a+b;
}
}
public partial class m
.. {
public int subtract(int a, int b)
{
return a - b;
}
}
private void button2_Click( object sender, EventArgs e)
{
m s = new m();
s.add(1, 2);
}