【正文】
補(bǔ)全C#代碼。4. }5. public class MyClass : IMsg6. {7. public virtual void Message()8. {9. (MyClass)。請(qǐng)分析下述代碼,并更正錯(cuò)誤代碼行。)10. lowerCase+=()。ch=39。amp。12. }13. }更正以下兩句:9. if (ch=39。)10. lowerCase+=。||ch=39。8. foreach (char ch in inputString)9. if (ch=39。2. public class Program3. {4. static void Main(string [] args)5. {6. string inputString=()。請(qǐng)檢查下列代碼,找出所有錯(cuò)誤的代碼,并寫出該行完整的正確代碼。2. 什么叫多態(tài)性,在C語(yǔ)言中如何實(shí)現(xiàn)多態(tài)?答:多態(tài)性是指一段程序能夠處理多種類型對(duì)象的能力。C. currentSeason = 。現(xiàn)在需要定義一個(gè)名為currentSeason的Season枚舉,并將其賦值為Spring,應(yīng)使用下面哪段代碼?dA. Season currentSeason = Spring。 D. int[][] array = new int[2,2]。 B. int[][] array = new int[2][2]。使用二維數(shù)組是一個(gè)解決方案。一個(gè)try代碼塊可以有多個(gè)catch塊于之對(duì)應(yīng)。程序從入口開始,調(diào)用某個(gè)私有方法將產(chǎn)生異常。int count{get{ return i。A. Hello in Base! B. Hello in Derived!C. Hello in Base! D. Hello in Derived!Hello in Derived! Hello in Base!12. 下列關(guān)于接口的說法中,哪個(gè)選項(xiàng)是正確的?(d)A. 一個(gè)類可以有多個(gè)基類和多個(gè)基接口B. 抽象類和接口都不能被實(shí)例化C. 抽象類和接口都可以對(duì)成員方法進(jìn)行實(shí)現(xiàn),但必須實(shí)現(xiàn)繼承的接口的方法13. 下列關(guān)于構(gòu)造函數(shù)的描述中,哪個(gè)選項(xiàng)是正確的?(a)A. 構(gòu)造函數(shù)必須與類名相同 B. 構(gòu)造函數(shù)不可以用private修飾C. 構(gòu)造函數(shù)不能帶參數(shù) D. 構(gòu)造函數(shù)可以聲明返回類型14. 引用數(shù)組元素時(shí),數(shù)組下標(biāo)的數(shù)據(jù)類型可以允許哪項(xiàng)類型?(c)A. 整型常量 B. 整型表達(dá)式C. 整型常量或整型表達(dá)式 D. 任何類型的表達(dá)式15. 以下類MyClass 的屬性count 屬于__c___屬性。Derived x = new Derived()。//先基后派}}class Derived : Base {public void Hello(){(Hello in Derived!)。 D. obj. Property()。 B. TestClass. Property()。則用該委托產(chǎn)生的回調(diào)方法的原型應(yīng)該是:b receive (int x) receive(int num) receive( ) 10. C中TestClass為一自定義類,其中有以下屬性定義public void Property{…}使用以下語(yǔ)句創(chuàng)建了該類的對(duì)象,并使變量obj引用該對(duì)象:TestClass obj=new TestClass()。A. 100 B.