设为首页 - 加入收藏 焦点技术网
热搜:java
当前位置:首页 >

dotnet2.0 测试题(C#)

导读:Donet2.0 using C# TestYou need to finish 40 questions in 40 minutes. Multiple-choice 1. Which of the following are true about anonymous methods?a. Anonymous methods have access to the local state of t...。。。

Donet2.0 using C# Test


You need to finish 40 questions in 40 minutes.

 

Multiple-choice

 

1. Which of the following are true about anonymous methods?
a. Anonymous methods have access to the local state of the containing function member
b. An anonymous method requires an explicit method signature
c. An anonymous method can impact the lifetime of local variables and parameters of the containing function
d. An anonymous method can access ref and out parameters of the containing function
e. A struct may not declare an anonymous method which directly references member fields

 

2. Which of the following conditions are true regarding System.Diagnostics.Trace?
a. Trace is enabled for both Release and Debug initial configurations
b. Trace can be controlled both by preprocessor directives, And complier directives
c. To change the severity levels which generate output, you must recompile you program
d. You can create enhanced capabilities by inheriting from the System.Diagnostics.Trace class

 

3. Which of the following are true about Nullable types?
a. A Nullable type is a reference type.
b. A Nullable type is structure.
c. An implicit conversion exists from any non-nullable value type to a nullable from of that type.
d. An implicit conversion exists from any nullable value type to a non-nullable from of that type.
e. A predefined conversion from the nullable type S to the nullable type T exists if there is a predefined conversion from the non-nullable type S to the non nullable type T

 

4. Which of the following are true for parameters?
a. Change to value parameters always involve making a copy of the original argument
b. Items passed as Reference Parameters must be initialized prior to the call
c. Output Parameters do not need to be assigned inside the method
d. Variable Length argument lists are not supported

 

5. Which of the following are true about event handing?
a. One method may handle event from different sources
b. A single event can be handled by multiple methods
c. Event handlers must be members of the same class as raised the event
d. Event handlers can be dynamically added and removed at runtime
e. It is impossible to determine the order in which event handlers will be invoked

 

6. Which of the following are true about namespaces and assemblies?
a. Namespaces may be used to control access to contained classes
b. Assemblies may be used to control access to contained classes
c. Namespaces may be aliased to provide a shorthand notation for a fully qualified identifier
d. The same namespace may be used in multiple assemblies
e. A single assemble may contain multiple namespaces

 

7. Which of the following are typical steps in creating a managed COM server component?
a. Assigning a GUID to each exposed interface and implementation via the System.Runtime.InteropServices.GuidAttribute
b. Enabling an unsafe code
c. Registering the server assembly with the system using RegAsm.exe
d. Registering the server assembly with the system using RegSvc32.exe
e. Making sure that the ComVisibleAttribute is not set to false for exported types and members

 

8. When Deleting a DataRow from the DataRowCollection of a DataTable, you can:
a. Use the DataRowCollection.Remove method to immediately delete the row.
b. Use the DataRowCollection.Remove method to mark the row for deletion when DataRow.AcceptChanges is called.
c. Use the DataRow.Delete method to immediately delete the row.
d. Use the DataRow.Delete method to mark the row for deletion when DataRowAcceptChanges is called.

 

9. Which of the following are true with respect to the standard implementation of Garbage Collection?
a. Objects must be set to null in order to be eligible for garbage collection
b. Unless specific steps are taken, an object may be moved in memory
c. Objects become eligible for garbage collection as soon as it is impossible for any code to access it
d. Objects which implement finalizers will always have the finalizer called at some point

 

10. which of the following are true about pointers?
a. C# does not support the use of “*” to indicate a pointer
b. Pointers are a type derived from System.Object
c. Pointers can be used as out and ref type parameters
d. Pointers references are tracked by the garbage collector.
e. Local variables do not require the use of a fixed statement to be used with pointers

 

11. Which of the following are defined as a “Token”?
a. Identifier
b. Whitespace
c. Punctuator
d. Operator
e. All of the above

 

12. Which of the following operators can be overloaded?
a. Assignment (=)
b. Conditional (&&, ||)
c. Logical (&, |, ^)
d. Shift (<< , >>)

 

13. Which of the following characteristics are found in an iterator?
a. It is a statement block which may contain a yield return statement to product the next value of the iteration
b. It is a statement block which may contain a yield break statement to product the next value of the iteration
c. It is a statement block which may contain a yield return statement to indicate that the iteration is complete
d. It is a statement block which may contain a yield break statement to indicate that the iteration is complete
e. It is a class which implements lenumerable

 

14. Which of the following properties are found in Static Constructors?
a. Static constructors are called before the main program is executed
b. Static constructors are called before the first instance of a class is created
c. Static constructors are called before any static (non-constructor) members are called
d. Static constructors can take parameters
e. If a static constructor throws an exception, never be invoked again and the type will remain uninitialized for the lifetime of the AppDomain

 

15. Which of the following can Interfaces contain?
a. Methods
b. Properties
c. Fields
d. Conversion operators
e. Events

 

16. Which of the following types guarantee atomic reads and writes?
a. int
b. double
c. string
d. long
e. float

 

Single-choice

 

17. If two assemblies contain the same fully qualified class, which of the following will be true?
a. It is impossible to add a reference to both assemblies to any given assembly
b. A new root can be added to the assemblies namespaces hierarchy by the use of an extern alias
c. The specific colliding name may be altered by using an extern alias
d. The collision may be avoided by using a statement to provide an alias

 

18. Which of the following is not an unboxing conversion?
a. void Sample1(object o) { int i = (int)o; }
b. void Sample1(ValueType vt) { int i = (int)vt; }
c. enum E{Hello, World}
void Sample1(System.Enum et) { E e = (E)et; }
d. interface I {int Value{get; set;}}
void Sample1(I vt) { int i = vt.Value; }
e. class C{public int Value{get; set;}}
void Sample1(C vt) { int i = vt.Value; }

 

19. To which of the following can System.IO.IsolatedStrorage not be scoped?
a. Restricted to a Specific Application
b. Restricted to a Specific AppDomain
c. Restricted to a Specific User
d. Restricted to a Specific Physical Media

 

20. Lin which of the following ways do structs differ from classes?
a. Structs cannot implement interfaces
b. Structs cannot inherit from a base struct
c. Structs cannot have event interfaces
d. Structs cannot have virtual methods

 

21. When developing a managed client to be used with an existing COM Component, __________
a. you should modify the COM component to enable CLR functionality.
b. You should use Tlblmp.exe to create a managed wrapper
c. You should use TlbExp.exe to create a managed wrapper
d. You should enable an unsafe code

 

22. Which of the following is NOT a requirement for an application to be certified in the “Certified for Windows Program”
a. Usage of system settings for size, color, and font
b. Support for Windows “High Contrast” option
c. Usage of sound to notify of critical information
d. Keyboard only access to all features including menu, and controls

 

23. Which of the following can one perform to create a System.Type instance for a given specialization of a generice?
a. Call the Type.MakeGenericType() method on an instance of System.Type which represents in Generic, specifying the types of the generic parameters.
b. Call the static Type.MakeGenericType(…) method specifying both the base type and the types of the generic parameters.
c. Call the GetType() method on an instance of the specialization
d. Call Reflection.Emit()
e. Call the Type.GetGenericTypeDefinition() method

 

24. With which class is the task of mapping a specific point in time into units, such as weeks, moths, and years accomplished?
a. System.DateTime
b. System.TimeSpan
c. System.Globalization.Calender
d. System.Globalization.CultureInfo

 

25. Which of the following are required to be true by objects which are going to be used as keys in a System.Collections.HashTable?
a. They must handle case-sensitivity identically in both the GetHashCode() and Equels() methods.
b. Key objects must be immutable for the duration they are used within a HashTable.
c. GetHashCode() must be overridden to provide the same result, given the same parameters, regardless of reference equality unless the HashTable constructor is provided with an IEqualityComparer parameter.
d. Each Element is a HashTable is stored as a Key/Value pair of the type System.Collections.DictionaryElement
e. All of the above

 

26. Which of the following is an effect of making resources in satellite assemblies?
a. It renders the resources unavailable.
b. It ensures that resources are used only with the appropriate culture
c. It prevents identifier collisions between multiple satellite assemblies
d. It has no impact since access specifiers for resources are not applied.

 

27. Which of the following is NOT part of an assembly?
a. Manifest
b. MetaData
c. Intermediate Language Code
d. Resources

 

28. What will be the output generated by the following Code?
string t = “This Is a Test”;    t.Replace(“T”, “?”);    Console.WriteLine(t);
a. ?his Is a ?est
b. ?his Is a ?es?
c. This Is a Test
d. ?his Is a Test

 

29. Which access limitation does a class member declared protected internal have?
a. Access is limited to the containing class plus any classes derived from the containing class
b. Access is limited to the current assembly
c. Access is limited to the containing class plus any classes derived from the containing class that are also in the current assembly
d. Access is limited to the containing class plus any classes derived from the containing class or any other class in the current assembly

 

30. Which System.Remoting class is used to transfer information across an AppDomain boundary
a. ObjRef
b. MarshalByRefObject
c. ObjectHandle
d. RemotingServices

 

31. Transactions initiated in which of the following are supported by System.Transactions infrastructure?
a. SQL Server
b. ADO.NET
c. MSMQ
d. Microsoft Distributed Transaction Coordinator(MSDTC).
e. All of the above

 

32. Which of the following is true about exceptions?
a. Exceptions should be derived from the System.Exception, but are not required to do so.
b. If no catch block is found for an exception, and the source is not a static constructor, a System.ThreadException will be thrown
c. Mathematical errors such as divide by zero, or numeric overflow will generate an exception that is derived from System.Exception
d. Every throw statement must have at least one catch block

 

33. Parameterized Properties in C# are __________
a. not supported exception for implementing and indexer.
b. properties which take one or more parameters (e.g. to retrieve one element from a member collection)
c. properties which use one or more attributes to control their behavior
d. properties which can be passed as Method Parameters so they can be invoked by the called method

 

34. Which of the following can an interface NOT contain?
a. Methods
b. Events
c. Fields
d. Indexers

 

35. Which of the following are true about operator precedence?
a. The Conditional Operator (?:) has the lowest precedence
b. All binary operators are left-associative, and evaluate from left to right.
c. The Assignment and Conditional Operators are right-associative
d. The Conditional And (&&) and Or(||) operators have higher precedence than the Logical And(|) Or(|) operators

 

36. Elements in a System.Collections.Specialized.OrderedDictonary are:
a. sorted by Key
b. sorted by Element
c. not sorted

 

37. Determining the availability of sufficient memory for an operation can be accomplished by?
a. There is no supported application level means to determine if a specific amount of memory is available.
b. using static methods of System.Runtime.MemoryFailPoint and checking the return value
c. creating an instance of System.Runtime.MemoryFailPoint and monitoring for an InsuffcientMemoryException
d. creating an instance of System.Runtime.MemoryFailPoint and monitoring for an OutOfMemoryException

 

38. class Sample{ public Sample(int x){} }
in the above code, which of the following other class constructors can directly access the provided constructor?

a. public Sample():this(1){}
b. public Sample():Sample(1){}
c. Both the above
d. One class constructor can not directly access another constructor

 

39. Which of the following is not a valid value for DataRowState?
a. Added
b. Modified
c. Dirty
d. Detached
e. Deleted

 

40. Which of the following is NOT a valid C# preprocessor directive?
a. #define
b. #line
c. #include
d. #error
e. #pragma

(编辑: patrickpan)

网友评论
相关文章