西西河

主题:【求助】关在酒店里考试,急问三道C#和SQL题。多谢!! -- bourne

共:💬11 🌺2
全看分页树展 · 主题 跟帖
家园 果然是伏波将军,马上就提供了援助。

第一题是多选,所以不确定除了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

全看分页树展 · 主题 跟帖


有趣有益,互惠互利;开阔视野,博采众长。
虚拟的网络,真实的人。天南地北客,相逢皆朋友

Copyright © cchere 西西河