2. short s1 = 1; s1 = s1 + 1;有什么错? short s1 = 1; s1 += 1;有什么错 ?
long型没关系
3. 获取分数最低的记录(可能有多条) SELECT TOP 1 with ties *
FROM [test].[dbo].[users] order by score asc
注:使用with ties 必须 有order by
4. 虚函数
static void Main(string[] args)
{ A a = new A(); C c = new C(); }
public class A
{public A(){ Console.WriteLine("DEBUG: A constructing"); this.GetYear();}
public virtual void GetYear(){Console.WriteLine("A");}
}
public class B:A
{public B():base(){Console.WriteLine("DEBUG: B constructing");this.GetYear();}
public override void GetYear(){Console.WriteLine("B");}
}
public class C : B
{public C(){Console.WriteLine("DEBUG : C constructing");this.GetYear();}
public override void GetYear(){Console.WriteLine("C");}
}
DEBUG: A constructing
A
DEBUG: A constructing
C
DEBUG: B constructing
C
DEBUG: C constructing
C