雅虎公司C#笔试题(完全整理版),看看你能解答多少?(4)

    技术2022-05-11  116

    Question 31. (单选)

    根据线程安全的相关知识,分析以下代码,当调用test方法时i>10时是否会引起死锁?

    public void test(int i)

    {

    lock(this)

    {

    if (i>10)

    {

    i--;

    test(i);

    }

    }

    }

    1. 会锁死

    2. 不会锁死

    Question 32. (单选)

    以下描述错误的是()

    1. 在C++中支持抽象类而在C#中不支持抽象类。

    2. C++中可在头文件中声明类的成员而在CPP文件中定义类的成员,在C#中没有头文件并且在同一处声明和定义类的成员。

    3. 在C#中可使用 new 修饰符显式隐藏从基类继承的成员。

    4. 在C#中要在派生类中重新定义基类的虚函数必须在前面加Override。

    Question 33. (单选)

    int[][] myArray3=new int[3][]{new int[3]{5,6,2},new int[5]{6,9,7,8,3},new int[2]{3,2}}; myArray3[2][2]的值是()。

    1. 9

    2. 2

    3. 6

    4. 越界

    Question 34. (单选)

    在C#中利用Socket进行网络通信编程的一般步骤是:建立Socket侦听、( )、利用Socket接收和发送数据。

    1. 建立Socket连接

    2. 获得端口号;

    3. 获得IP地址;

    4. 获得主机名;

    Question 35. (单选)

    如果设treeView1=new TreeView(),TreeNode node=new TreeNode("根结点" ),则treeView1.Nodes.Add(node)返回的是一个 ()类型的值。

    1. TreeNode;

    2. int;

    3. string;

    4. TreeView;

    Question 36. (单选)

    声明一个委托public delegate int myCallBack(int x); 则用该委托产生的回调方法的原型应该是

    1. void myCallBack(int x)

    2. int receive(int num)

    3. string receive(int x)

    4. 不确定的

    Question 37. (单选)

    关于ASP.NET中的代码隐藏文件的描述正确的是

    1. Web窗体页的程序的逻辑由代码组成,这些代码的创建用于与窗体交互。编程逻辑唯一与用户界面不同的文件中。该文件称作为“代码隐藏”文件,如果用C#创建,该文件

    2. 项目中所有Web窗体页的代码隐藏文件都被编译成.EXE文件

    3. 项目中所有的Web窗体页的代码隐藏文件都被编译成项目动态链接库(.dll)文件

    4. 以上都不正确

    Question 38. (单选)

    What compiler switch creates an xml file from the xml comments in the files in an assembly?

    1. /text

    2. /doc

    3. /xml

    4. /help

    Question 39. (单选)

    下面的代码实现了设计模式中的什么模式

    public class A {

    private A instance;

    private A() {

    }

    public static A Instance {

    get

    {

    if ( A == null )

    A = new A();

    return instance;

    }

    }

    }

    1. Factory

    2. Abstract Factory

    3. Singleton

    4. Builder

    Question 40. (单选)

    class Class1

    {

    public static int Count = 0;

    static Class1()

    {

    Count++;

    }

    public Class1()

    {

    Count++;

    }

    }

    Class1 o1 = new Class1();

    Class1 o2 = new Class1();

    请问,Class1.Count的值是多少?( )

    1. 1

    2. 2

    3. 3

    4. 4

    关键字:软件  服务器  qq  os  msn  dos   美女 电影 小说 音乐 无极 汽车 MP3


    最新回复(0)