知名公司笔试题目

时间:2017-08-25 笔试题目 我要投稿

下面来看看这份由应届毕业生笔试频道推荐的笔试题

1:In Object Oriented Programming, how would you describe encapsulation?

  A.The conversion of one type of object to another.

  B.The runtime resolution of method calls.

  C.The exposition of data.

  D.The separation of interface and implementation.

2:如下程序的运行结果是:public abstract class A{public A(){Console.WriteLine(''A'');}public virtual void Fun(){Console.WriteLine("A.Fun()");}}public class B: A{public B(){Console.WriteLine(''B'');}public new void Fun(){Console.WriteLine("B.Fun()");}public static void Main(){A a = new B();a.Fun();}}

  A.A B A.Fun()

  B.A B B.Fun()

  C.B A A.Fun()

  D.B A B.Fun()

3:Which of these string definitions will prevent escaping on backslashes in C#?

  A.string s = #”n Test string”;

  B.string s = “’n Test string”;

  C.string s = @”n Test string”;

  D.string s = “n Test string”;

4:假定a和b为int型变量,则执行下述语句组后,b的值为a=1;b=10;do{b-=a;a++;} while (b--<0);

  A.9

  B.-2

  C.-1

  D.8

5:abstract class BaseClass{public virtual void MethodA(){Console.WriteLine("BaseClass");}public virtual void MethodB(){}}class Class1: BaseClass{public void MethodA(){Console.WriteLine("Class1");}public override void MethodB(){}}class Class2: Class1{new public void MethodB(){}}class MainClass{public static void Main(string[] args){Class2 o = new Class2();o.MethodA();}}请问,此程序输出结果是:

  A.BaseClass

  B.BassClass Class1

  C.Class1

  D.Class1 BassClass

 

知名公司笔试题目相关推荐