亚洲福利精品久久久久91|中文字幕乱码视频网|在线播放国产精品一区二区|亚洲成AV人片女在线观看

<thead id="tzpj5"></thead>
  • <cite id="tzpj5"><listing id="tzpj5"></listing></cite>
    <strike id="tzpj5"><option id="tzpj5"><td id="tzpj5"></td></option></strike>

    用友軟件筆試真題兩套(一)

    思而思學(xué)網(wǎng)

    第一套:用友軟件筆試題目

    1、 面向?qū)ο蟮恼Z言具有___封裝__性、___繼承__性、___多態(tài)_性。

    2、 能用foreach遍歷訪問的對象需要實現(xiàn) __ IEnumerable __接口或聲明__GetEnumerator __方法的類型。

    3、 以下敘述正確的是:

    A. 接口中可以有虛方法。 B. 一個類可以實現(xiàn)多個接口。

    C. 接口不能被實例化。 D. 接口中可以包含已實現(xiàn)的方法。

    4、 簡述 private、 protected、 public、 internal 修飾符的訪問權(quán)限。

    Private 私有成員:只有本類內(nèi)部可以訪問

    Protected 受保護(hù)成員:只有本類和本類的子類可以訪問

    Public 公有成員:完全公開,沒有訪問限制

    Internal :在同一命名空間下可以訪問

    5、寫出一條Sql語句: 取出表A中第31到第40記錄(SQLServer, 以自動增長的ID作為主鍵, 注意:ID可能不是連續(xù)的。)

    select top 10 from A where id not in (select top 30 id from A)

    5、 DataReader與DataSet有什么區(qū)別?

    (1)、dataset表示一個數(shù)據(jù)集,是數(shù)據(jù)在內(nèi)存中的緩存。 可以包括多個表;

    (2)、dataset連接數(shù)據(jù)庫時是非面向連接的。把表全部讀到Sql中的緩沖池,并斷開于數(shù)據(jù)庫的連接

    (3)、datareader 連接數(shù)據(jù)庫時是面向連接的。讀表時,只能向前讀取,讀完數(shù)據(jù)后有用戶決定是否斷開連接。

    6、 簡述什么是裝箱?

    把一個值類型的數(shù)據(jù)轉(zhuǎn)換為引用類型的數(shù)據(jù)的過程叫裝箱。

    7、 下列選項中,(c)是引用類型。

    a) enum類型 b) struct類型

    c) string類型 d) int類型

    8、 一個數(shù)據(jù)庫中的一個表中有 year 、salary這兩個字段,原表中數(shù)據(jù)如原表,請用SQL查詢出結(jié)果顯示的數(shù)據(jù):

    原表中數(shù)據(jù):

    year salary

    -----------------------------------------

    2000 1000

    2001 2000

    2002 3000

    2003 4000

    結(jié)果表中數(shù)據(jù):

    year salary

    ------------------------------------------

    2000 1000

    2001 3000

    2002 6000

    2003 10000

    寫出SQL語句如下:

    create table test([year] int ,salary int)

    insert test(year,salary) values(2000,1000)

    insert test(year,salary) values(2001,2000)

    insert test(year,salary) values(2002,3000)

    insert test(year,salary) values(2003,4000)

    select t1.year, (select sum(salary) from test as t2 where t2.year<=t1.year) as salary from test t1 order by year asc

    9、運(yùn)行下列代碼:

    class A

    {

    public A()

    {

    PrintFields();

    }

    public virtual void PrintFields(){}

    }

    class B : A

    {

    int x = 1;

    int y;

    public B()

    {

    y = -1;

    }

    public override void PrintFields()

    {

    Console.WriteLine("x={0},y={1}", x, y);

    }

    }

    new B()時,輸出的結(jié)果是:x=?;y=?

    x=1;y=0

    10、用C#寫出singleton(單例)模式的例子?

    <一>、我對單例模式的理解說明如下:

    單例模式的意圖是:保證一個類僅有一個實例,并提供一個訪問它的全局訪問點(diǎn)。

    它的工作原理是:用一個特殊的方法來實例化所需的對象。其中最關(guān)鍵的就是這個特殊的方法:

    (1)、調(diào)用這個方法時,檢查對象是否已經(jīng)實例化。如果已經(jīng)實例化,該方法僅返回對該對象的一個引用。如果尚未實例化,該方法就實例化該對象并返回對此新實例的一個引用。

    (2)、為了確保這是實例化此類型對象的唯一方法,我將這個類的構(gòu)造函數(shù)定義為保護(hù)的或者私有的。

    <二>、詳細(xì)實例如下:

    using System;

    class Singleton

    {

    private static Singleton instance;

    protected Singleton() {}

    public static Singleton Instance()

    {

    if( instance == null )

    instance = new Singleton();

    return instance;

    }

    }

    public class Client

    {

    public static void Main()

    {

    Singleton s1 = Singleton.Instance();

    Singleton s2 = Singleton.Instance();

    if( s1 == s2 )

    Console.WriteLine( "The same instance" );

    }

    }

    熱門推薦

    最新文章