首页 > 代码库 > C# 笔试题,看你会几道题
C# 笔试题,看你会几道题
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?
- System.Int8
- System.Int16
- System.Int32
- System.Int64
C# 笔试题,看你会几道题
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。