码迷,mamicode.com
首页 > Windows程序 > 详细

C# 笔试题,看你会几道题

时间:2014-12-05 00:42:43      阅读:298      评论:0      收藏:0      [点我收藏+]

标签:style   io   ar   sp   for   strong   on   bs   cti   

1.       Which interface you need to implement to support for each?

    • IEnumerator
    • IEnumerable
    • IComparer
    • IComparable
    • All of the above
    • None of the above

 

2.       What is the “internal” keyword used for?

    • To make a method to be used internally by the declaring class only.
    • To make a field that is accessed by multiple threads.
    • To use with the DllImport attribute when using Interop services to call into unmanaged code.
    • None of the above

 

3.       Read the following 2 statements about const and read-only field

    • A const field can only be initialised where it’s declared. A read-only field can be initialised where it’s declared or in a constructor.
    • A const field is set at compile time, but a read-only field is set at run time.

 

  • 4.       Read the following statements about structs.
    • Structs are value types.
    • Structs are reference types.
    • Structs can be directly derived from System.Object.
    • Structs can be directly derived from System.ValueType.
    • Structs only allocate memory from stack.

 

  • 5.       What is the keyword “delegate” used for?
    • Another visibility modifier like public, private, protected
    • Used in multi threaded programs to protect a variable
    • Used to define a method signature type that can be used as a typed variable
    • None of the above

 

  • 6.       What is “boxing”?
    • Wrapping an object into a value type
    • Wrapping a value type into an object
    • Wrapping a collection into a byte array
    • None of the above

 

  • 7.       Can I use “return” statement inside a “final” block?
    • Yes
    • No

 

  • 8.       Is Delegate a type of Event?
    • Yes
    • No

 

  • 9.       If x.Equals(y) is true. Is it correct that x.GetHashcode() != y.GetHashcode()?
    • Yes
    • No

 

  • 10.   int keyword targets to which .Net type?
    1. System.Int8
    2. System.Int16
    3. System.Int32
    4. System.Int64

C# 笔试题,看你会几道题

标签:style   io   ar   sp   for   strong   on   bs   cti   

原文地址:http://www.cnblogs.com/haiyu/p/4145255.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!