面試題之二

來源:互聯網
上載者:User

1.公司要求開發一個繼承System.Windows.Forms.ListView類的組件,要求達到以下的特殊功能:點擊ListView各列列頭時,能按照點擊列的

每行值進行重排視圖中的所有行 (排序的方式如DataGrid相似)。根據您的知識,請簡要談一下您的思路
答:根據點擊的列頭,包該列的ID取出,按照該ID排序後,在給綁定到ListView中。

2.給定以下XML檔案,完成演算法流程圖。
<FileSystem>
< DriverC >
<Dir DirName=”MSDOS622”>
<File FileName =” Command.com” ></File>
</Dir>
<File FileName =”MSDOS.SYS” ></File>
<File FileName =” IO.SYS” ></File>
</DriverC>
</FileSystem>
請畫出遍曆所有檔案名稱(FileName)的流程圖(請使用遞迴演算法)。
答:
void FindFile( Directory d )
{
   FileOrFolders = d.GetFileOrFolders();
   foreach( FileOrFolder fof in FileOrFolders ) 
   {
     if( fof is File ) 
     You Found a file;
     else if ( fof is Directory ) 
     FindFile( fof );
    }
}

3.寫出一條Sql語句:取出表A中第31到第40記錄(SQLServer,以自動成長的ID作為主鍵,注意:ID可能不是連續的。
答:解1:  select top 10 * from A where id not in (select top 30 id from A)
    解2:  select top 10 * from A where id > (select max(id) from (select top 30 id from A )as A)

4.物件導向的語言具有________性、_________性、________性
答:封裝、繼承、多態。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.