主题:【求助】关在酒店里考试,急问三道C#和SQL题。多谢!! -- bourne
第一题是多选,所以不确定除了D以外还有没有。第二题错在(a = 20)。第三题是10 x 10。
多谢了!
想再问一道:
What will happen when the programs executes?
public abstract class Account
{
public int GetAccountBalance()
{
return 1000;
}
}
public class SavingAccount: Account
{
public new int GetAccountBalance()
{
return 2000;
}
}
public new int GetAccountBalance()
{
return 2000;
}
public class Driver
{
public static void Main (string[] args)
{
Account pa = new SavingAccount();
Console.Write(pa.GetAccountBalance().ToString());
}
}
Select one answer:
A.Throws an InvalidCastException
B.Throws an ArgumentException
C.Outputs “1000” and quits
D.Outputs “2000” and quits
- 相关回复 上下关系7
🙂C#与C有不同 偶然 字77 2008-01-18 07:48:02
🙂这个算机经的实时版本了吧~ 知之后哀 字0 2008-01-15 02:16:34
🙂试一试 1 伏波将军 字17 2008-01-15 01:58:22
🙂果然是伏波将军,马上就提供了援助。
🙂汗,这个有点复杂,我也吃不准了。手边没有环境。。。 1 伏波将军 字0 2008-01-15 05:26:02
🙂我被if (a = 20)给蒙蔽过去了,看了你的答案才找出来 瓦斯 字10 2008-01-15 02:04:55
🙂哈,有时候简单的错误反而比较麻烦。 伏波将军 字68 2008-01-15 02:18:58