Upwork DotNet 2.0 using C# Test 2016.
66 Answered Test Questions:
1. Which of the following are true when comparing built in types for equality?
Answers:
a. Integral types are considered equal if they represent the same value.
a. Object types are considered equal if they both refer to the same object or if both are null
a. String types are considered equal if they have identical lengths and identical characters in each character position
a. String types are considered equal if they have identical dimensions and identical content at each array index
2. Which of the following types guarantee atomic reads and writes?
Answers:
a. int
a. double
a. string
a. long
a. float
3. Which of the following types are derived from System.Reflection.MemberInfo?
Answers:
a. System.Reflection.PropertyInfo
a. System.Reflection.EventInfo
a. System.Type
a. System.Reflection.InstanceInfo
4. Which of the following applies to interface inheritance?
Answers:
a. If a class implements an interface, the implementation can be provided by a public member of a base class.
a. A class may partially implement an interface by only declaring some of the members
a. Interface methods may be implemented so that they are NOT directly accessible using an instance reference to the class
a. Since interface implementation methods can not be declared private,protected, or internal, they are always accessible from any point in an application
5. Which of the following operators can be overloaded?
Answers:
a. Assignment (=)
a. Conditional (&&,||)
a. Logical (&,|,^)
a. Shift (<<, >>)
6. Which of the following are true about using the System.Messaging.MessageQueue class?
Answers:
a. It provides communication across heterogeneous networks
a. It provides communication when one of the endpoints may be off-line
a. It may behave differently depending on the current operating system
a. A new system level queue may be created simply by creating an instance of MessageQueue.
7. Which of the following characteristics are found in an iterator?
Answers:
a. It is a statement block which may contain a yield return statement to provide the next value of the iteration
a. It is a statement block which may contain a yield break statement to provide the next value of the iteration
a. It is a statement block which may contain a yield return statement to indicate that the iteration is complete
a. It is a statement block which may contain a yield break statement to indicate that the iteration is complete
a. It is a class which implements Ienumerable
8. Which of the following are true for parameters?
Answers:
a. Changes to value parameters always involve making a copy of the original argument
a. Items passed as Reference Parameters must be initialized prior to the call
a. Output Parameters do not need to be assigned inside the method
a. Variable Length argument lists are not supported
9. Which of the following are true about using ADO.NET DataSets and DataTables?
Answers:
a. The connection to the database must remain valid for the life of the data objects
a. All tables in a dataset must come from the same database.
a. A given instance of a DataTable can be in only one DataSet
a. Changes made to multiple tables within a DataSet can easily be extracted to a new DataSet which contains only the changes
a. Content from multiple DataSets can easily be combined into a single DataSet that contains the net result of all changes.
10. Which of the following are true with respect to the standard implementation of Garbage Collection?
Answers:
a. Objects must be set to null in order to be eligible for garbage collection
a. Unless specific steps are taken, an object may be moved in memory
a. Objects become eligible for garbage collection as soon as it is impossible for any code to access it
a. Objects which implement finalizers will always have the finalizer called at some point
11. Which of the following are true about Nullable types?
Answers:
a. A Nullable type is a reference type.
a. A Nullable type is a structure.
a. An implicit conversion exists from any non-nullable value type to a nullable form of that type.
a. An implicit conversion exists from any nullable value type to a non-nullable form of that type.
12. Which of the following are true about declarative attributes?
Answers:
a. They must be inherited from the System.Attribute.
a. Attributes are instantiated at the same time as instances of the class to which they are applied.
a. Attribute classes may be restricted only to be applied to application element types.
a. By default, a given attribute may be applied multiple times to the same application element.
13. What output will be generated by the following code?
1. Which of the following are true when comparing built in types for equality?
Answers:
a. Integral types are considered equal if they represent the same value.
a. Object types are considered equal if they both refer to the same object or if both are null
a. String types are considered equal if they have identical lengths and identical characters in each character position
a. String types are considered equal if they have identical dimensions and identical content at each array index
2. Which of the following types guarantee atomic reads and writes?
Answers:
a. int
a. double
a. string
a. long
a. float
3. Which of the following types are derived from System.Reflection.MemberInfo?
Answers:
a. System.Reflection.PropertyInfo
a. System.Reflection.EventInfo
a. System.Type
a. System.Reflection.InstanceInfo
4. Which of the following applies to interface inheritance?
Answers:
a. If a class implements an interface, the implementation can be provided by a public member of a base class.
a. A class may partially implement an interface by only declaring some of the members
a. Interface methods may be implemented so that they are NOT directly accessible using an instance reference to the class
a. Since interface implementation methods can not be declared private,protected, or internal, they are always accessible from any point in an application
5. Which of the following operators can be overloaded?
Answers:
a. Assignment (=)
a. Conditional (&&,||)
a. Logical (&,|,^)
a. Shift (<<, >>)
6. Which of the following are true about using the System.Messaging.MessageQueue class?
Answers:
a. It provides communication across heterogeneous networks
a. It provides communication when one of the endpoints may be off-line
a. It may behave differently depending on the current operating system
a. A new system level queue may be created simply by creating an instance of MessageQueue.
7. Which of the following characteristics are found in an iterator?
Answers:
a. It is a statement block which may contain a yield return statement to provide the next value of the iteration
a. It is a statement block which may contain a yield break statement to provide the next value of the iteration
a. It is a statement block which may contain a yield return statement to indicate that the iteration is complete
a. It is a statement block which may contain a yield break statement to indicate that the iteration is complete
a. It is a class which implements Ienumerable
8. Which of the following are true for parameters?
Answers:
a. Changes to value parameters always involve making a copy of the original argument
a. Items passed as Reference Parameters must be initialized prior to the call
a. Output Parameters do not need to be assigned inside the method
a. Variable Length argument lists are not supported
9. Which of the following are true about using ADO.NET DataSets and DataTables?
Answers:
a. The connection to the database must remain valid for the life of the data objects
a. All tables in a dataset must come from the same database.
a. A given instance of a DataTable can be in only one DataSet
a. Changes made to multiple tables within a DataSet can easily be extracted to a new DataSet which contains only the changes
a. Content from multiple DataSets can easily be combined into a single DataSet that contains the net result of all changes.
10. Which of the following are true with respect to the standard implementation of Garbage Collection?
Answers:
a. Objects must be set to null in order to be eligible for garbage collection
a. Unless specific steps are taken, an object may be moved in memory
a. Objects become eligible for garbage collection as soon as it is impossible for any code to access it
a. Objects which implement finalizers will always have the finalizer called at some point
11. Which of the following are true about Nullable types?
Answers:
a. A Nullable type is a reference type.
a. A Nullable type is a structure.
a. An implicit conversion exists from any non-nullable value type to a nullable form of that type.
a. An implicit conversion exists from any nullable value type to a non-nullable form of that type.
12. Which of the following are true about declarative attributes?
Answers:
a. They must be inherited from the System.Attribute.
a. Attributes are instantiated at the same time as instances of the class to which they are applied.
a. Attribute classes may be restricted only to be applied to application element types.
a. By default, a given attribute may be applied multiple times to the same application element.
13. What output will be generated by the following code?
StringBuilder sb = new StringBuilder(10);
sb.AppendFormat(“1234567890123”);
Console.WriteLine(sb.Capacity);
Answers:
a. 10
a. 20
a. Some value equal to or larger than 13
a. Int32.MaxValue
14. The term Encapsulation is most commonly used to mean:
Answers:
a. separating an item’s public interface from the actual implementation
a. embedding content as a resource into an executable program
a. providing a short summary description of complex operations
a. a technique using base and derived classes
15. Which of the following are true about namespaces and assemblies?
Answers:
a. A single assembly may contain multiple namespaces
a. The same namespace may be used in multiple assemblies
a. Namespaces may be aliased to provide a shorthand notation for a fully qualified identifier
a. All of the above
16. Which of the following are true about pointers?
Answers:
a. C# does not support the use of “*” to indicate a pointer.
a. Pointers are a type derived from System.Object
a. Pointers can be used as out and ref type parameters
a. Pointer references are tracked by the garbage collector.
17. The framework provides three different timer classes. Select the answer that properly matches the class with the listed characteristic.
Answers:
a. System.Threading.Timer A simple timer which requires a delegate to be supplied for execution when the timer expires. Execution of the method provided by the delegate will be invoked on a ThreadPool Thread.
a. System.Timers.Timer: Designed for use with worker threads in a multithreaded environment. Can move among threads to handle the raised Elapsed event May result in more accuracy than the System.Windows.Forms.Timer instances.
a. System.Windows.Forms.Timer A lower resolution timer which requires a UI message pump on the creating thread.
a. All of the above
18. Transactions initiated in which of the following are supported by System.Transactions infrastructure?
Answers:
a. SQL Server
a. ADO.NET
a. MSMQ
a. Microsoft Distributed Transaction Coordinator (MSDTC).
a. All of the above
19. Which of the following is not a valid value for DataRowState?
Answers:
a. Added
a. Modified
a. Dirty
a. Detached
a. Deleted
20. With which class is the task of mapping a specific point in time into units, such as weeks, months, and years accomplished?
Answers:
a. System.DateTime
a. System.TimeSpan
a. System.Globalization.Calendar
a. System.Globalization.CultureInfo
21. Which of the following are required to be true by objects which are going to be used as keys in a System.Collections.HashTable?
Answers:
a. They must handle case-sensitivity identically in both the GetHashCode() and Equals() methods.
a. Key objects must be immutable for the duration they are used within a HashTable.
a. Get HashCode() must be overridden to provide the same result, given the same parameters, regardless of reference equalityl unless the HashTable constructor is provided with an IEqualityComparer parameter.
a. All of the above
22. Which of the following is NOT a valid C# preprocessor directive?
Answers:
a. #define
a. #line
a. #include
a. #error
a. #pragma
23. Which of the following are valid as the underlying type for an enumeration?
Answers:
a. int
a. sbyte
a. long
a. All of the above
24. Which of the following can an interface NOT contain?
Answers:
a. Methods
a. Events
a. Fields
a. Indexers
25. Which of the following is true about exceptions?
Answers:
a. Exceptions should be derived from the System.Exception, but are not required to do so.
a. If no catch block is found for an exception, and the source is not a static constructor, a System.ThreadException will be thrown
a. Mathematical errors such as divide by zero, or numeric overflow will generate an exception that is derived from System.Exception
a. Every throw statement must have at least one catch block
26. Which of the following is false regarding arrays?
Answers:
a. For reference types A and B; if a conversion from A to B exists, a conversion from A[] to B[] also exists
a. For value types A and B; if a conversion from A to B exists, a conversion from A[] to B[] also exists
a. Assignments to arrays elements may require a runtime check to validate the type safety of the assignment
27. Which of the following is an effect of marking resources in satellite assemblies?
Answers:
a. It renders the resources unavailable.
a. It ensures that resources are used only with the appropriate culture
a. It prevents identifier collisions between multiple satellite assemblies
a. It has no impact since access specifiers for resources are not applied.
28. When developing a managed client to be used with an existing COM Component, __________.
Answers:
a. you should modify the COM component to enable CLR functionallity.
a. you should use TlbImp.exe to create a managed wrapper
a. you should use TlbExp.exe to create a managed wrapper
a. you should enable an unsafe code
29. Which of the following is true about C# generics?
Answers:
a. C# allows non-type template parameters
a. C# supports explicit specialization
a. C# allows the type parameter to be used as the base class for the generic type
a. C# allows a generic type parameter itself to be a generic
a. C# enforces that all codes are valid for all types of parameters
30. Which System.Runtime.Remoting class is used to store all relevant information required to generate a proxy in order to communicate with a remote object?
Answers:
a. ObjRef
a. MarshalByRefObject
a. ObjectHandle
a. RemotingServices
31. Which of the following characteristics is found in The DateTime type?
Answers:
a. It always references the UTC (GMT) time
a. It always references the Local time
a. It contains a member indicating which time zone it refers to
a. It contains a member indicating whether it is UTC, Local, or Unspecified
32. Which of the following are true about anonymous methods?
Answers:
a. Anonymous methods have access to the local state of the containing function member.
a. An anonymous method requires an explicit method signature
a. An anonymous method can impact the lifetime of local variables and parameters of the containing function
a. A struct may not declare an anonymous method which directly references member fields
33. Elements in a System.Collections.Specialized.OrderedDictionary are:
Answers:
a. sorted by Key
a. sorted by Element
a. not sorted
34. Which of the following is NOT part of an assembly?
Answers:
a. Manifest
a. MetaData
a. Intermediate Language Code
a. Resources
a. Native Executable Code
35. Which of the following characteristics do classes in the System.Drawing namespace such as Brush,Font,Pen, and Icon share?
Answers:
a. They encapsulate native resources and must be properly Disposed to prevent potential exhausting of resources.
a. They are Value Type objects.
a. You can inherit from these classes to provide enhanced or customized functionality
a. None of the Above
36. Which of the following is not a valid attribute for impacting serialization?
Answers:
a. DataContractAttribute
a. DataMemberAttribute
a. EnumMemberAttribute
a. CollectionDataContractAttribute
a. DataObjectAttribute
37. class Sample
{
public Sample(int x) { }
}
sb.AppendFormat(“1234567890123”);
Console.WriteLine(sb.Capacity);
Answers:
a. 10
a. 20
a. Some value equal to or larger than 13
a. Int32.MaxValue
14. The term Encapsulation is most commonly used to mean:
Answers:
a. separating an item’s public interface from the actual implementation
a. embedding content as a resource into an executable program
a. providing a short summary description of complex operations
a. a technique using base and derived classes
15. Which of the following are true about namespaces and assemblies?
Answers:
a. A single assembly may contain multiple namespaces
a. The same namespace may be used in multiple assemblies
a. Namespaces may be aliased to provide a shorthand notation for a fully qualified identifier
a. All of the above
16. Which of the following are true about pointers?
Answers:
a. C# does not support the use of “*” to indicate a pointer.
a. Pointers are a type derived from System.Object
a. Pointers can be used as out and ref type parameters
a. Pointer references are tracked by the garbage collector.
17. The framework provides three different timer classes. Select the answer that properly matches the class with the listed characteristic.
Answers:
a. System.Threading.Timer A simple timer which requires a delegate to be supplied for execution when the timer expires. Execution of the method provided by the delegate will be invoked on a ThreadPool Thread.
a. System.Timers.Timer: Designed for use with worker threads in a multithreaded environment. Can move among threads to handle the raised Elapsed event May result in more accuracy than the System.Windows.Forms.Timer instances.
a. System.Windows.Forms.Timer A lower resolution timer which requires a UI message pump on the creating thread.
a. All of the above
18. Transactions initiated in which of the following are supported by System.Transactions infrastructure?
Answers:
a. SQL Server
a. ADO.NET
a. MSMQ
a. Microsoft Distributed Transaction Coordinator (MSDTC).
a. All of the above
19. Which of the following is not a valid value for DataRowState?
Answers:
a. Added
a. Modified
a. Dirty
a. Detached
a. Deleted
20. With which class is the task of mapping a specific point in time into units, such as weeks, months, and years accomplished?
Answers:
a. System.DateTime
a. System.TimeSpan
a. System.Globalization.Calendar
a. System.Globalization.CultureInfo
21. Which of the following are required to be true by objects which are going to be used as keys in a System.Collections.HashTable?
Answers:
a. They must handle case-sensitivity identically in both the GetHashCode() and Equals() methods.
a. Key objects must be immutable for the duration they are used within a HashTable.
a. Get HashCode() must be overridden to provide the same result, given the same parameters, regardless of reference equalityl unless the HashTable constructor is provided with an IEqualityComparer parameter.
a. All of the above
22. Which of the following is NOT a valid C# preprocessor directive?
Answers:
a. #define
a. #line
a. #include
a. #error
a. #pragma
23. Which of the following are valid as the underlying type for an enumeration?
Answers:
a. int
a. sbyte
a. long
a. All of the above
24. Which of the following can an interface NOT contain?
Answers:
a. Methods
a. Events
a. Fields
a. Indexers
25. Which of the following is true about exceptions?
Answers:
a. Exceptions should be derived from the System.Exception, but are not required to do so.
a. If no catch block is found for an exception, and the source is not a static constructor, a System.ThreadException will be thrown
a. Mathematical errors such as divide by zero, or numeric overflow will generate an exception that is derived from System.Exception
a. Every throw statement must have at least one catch block
26. Which of the following is false regarding arrays?
Answers:
a. For reference types A and B; if a conversion from A to B exists, a conversion from A[] to B[] also exists
a. For value types A and B; if a conversion from A to B exists, a conversion from A[] to B[] also exists
a. Assignments to arrays elements may require a runtime check to validate the type safety of the assignment
27. Which of the following is an effect of marking resources in satellite assemblies?
Answers:
a. It renders the resources unavailable.
a. It ensures that resources are used only with the appropriate culture
a. It prevents identifier collisions between multiple satellite assemblies
a. It has no impact since access specifiers for resources are not applied.
28. When developing a managed client to be used with an existing COM Component, __________.
Answers:
a. you should modify the COM component to enable CLR functionallity.
a. you should use TlbImp.exe to create a managed wrapper
a. you should use TlbExp.exe to create a managed wrapper
a. you should enable an unsafe code
29. Which of the following is true about C# generics?
Answers:
a. C# allows non-type template parameters
a. C# supports explicit specialization
a. C# allows the type parameter to be used as the base class for the generic type
a. C# allows a generic type parameter itself to be a generic
a. C# enforces that all codes are valid for all types of parameters
30. Which System.Runtime.Remoting class is used to store all relevant information required to generate a proxy in order to communicate with a remote object?
Answers:
a. ObjRef
a. MarshalByRefObject
a. ObjectHandle
a. RemotingServices
31. Which of the following characteristics is found in The DateTime type?
Answers:
a. It always references the UTC (GMT) time
a. It always references the Local time
a. It contains a member indicating which time zone it refers to
a. It contains a member indicating whether it is UTC, Local, or Unspecified
32. Which of the following are true about anonymous methods?
Answers:
a. Anonymous methods have access to the local state of the containing function member.
a. An anonymous method requires an explicit method signature
a. An anonymous method can impact the lifetime of local variables and parameters of the containing function
a. A struct may not declare an anonymous method which directly references member fields
33. Elements in a System.Collections.Specialized.OrderedDictionary are:
Answers:
a. sorted by Key
a. sorted by Element
a. not sorted
34. Which of the following is NOT part of an assembly?
Answers:
a. Manifest
a. MetaData
a. Intermediate Language Code
a. Resources
a. Native Executable Code
35. Which of the following characteristics do classes in the System.Drawing namespace such as Brush,Font,Pen, and Icon share?
Answers:
a. They encapsulate native resources and must be properly Disposed to prevent potential exhausting of resources.
a. They are Value Type objects.
a. You can inherit from these classes to provide enhanced or customized functionality
a. None of the Above
36. Which of the following is not a valid attribute for impacting serialization?
Answers:
a. DataContractAttribute
a. DataMemberAttribute
a. EnumMemberAttribute
a. CollectionDataContractAttribute
a. DataObjectAttribute
37. class Sample
{
public Sample(int x) { }
}
In the above code, which of the following other class constructors can directly access the provided constructor?
Answers:
a. public Sample() : this(1) { }
a. public Sample() : Sample(1) {}
a. Both the above.
a. One class constructor can not directly access another constructor
38. Which of the following code samples will cause a compilation error?
Answers:
a. class SampleClass {} class SampleClass {}
a. class SampleClass {} class SampleClass<T,U> {}
a. class SampleClass where T : class { } class SampleClass where T : struct { }
a. class SampleClass {} class SampleClass where T : class { }
39. Which of the following are true about statements?
Answers:
a. A while statement will always execute its body at least once.
a. A for loop will always execute its body at least once.
a. A try statement must always include at least one catch block
a. A case clause within a switch statement may not fall through to the next case clause
40. If two assemblies contain the same fully qualified class, which of the following will be true?
Answers:
a. It is impossible to add a reference to both assemblies to any given assembly
a. A new root can be added to the assemblies namespace hierarchy by the use of an extern alias
a. The specific colliding name may be altered by using an extern alias
a. The collision may be avoided by using a statement to provide an alias
41. Which of the following are true about delegates?
Answers:
a. A delegate requires an instance method be supplied.
a. A delegate instance may encapsulate only one method
a. Delegates are not typesafe
a. A delegate instance does not know or care about the class type of the encapsulated method
42. When Deleting a DataRow from the DataRowCollection of a DataTable, you can:
Answers:
a. use the DataRowCollection.Remove method to immediately delete the row.
a. use the DataRowCollection.Remove method to mark the row for deletion when DataRow.AcceptChanges is called.
a. use the DataRow.Delete method to immediately delete the row.
a. use the DataRow.Delete method to mark the row for deletion when DataRowAcceptChanges is called.
43. Which of the following is NOT a requirement for an application to be certified in the “Certified for Windows Program”?
Answers:
a. Usage of system settings for size, color, and font
a. Support for Windows “High Contrast” option
a. Usage of sound to notify of critical information
a. Keyboard only access to all features including menus, and controls
44. Which access limitation does a class member declared protected internal have?
Answers:
a. Access is limited to the containing class plus any classes derived from the containing class
a. Access is limited to the current assembly
a. Access is limited to the containing class plus any classes derived from the containing class that are also in the current assembly
a. Access is limited to the containing class plus any classes derived from the containing class or any other class in the current assembly
45. Which of the following operations can NOT be performed inside a catch block?
Answers:
a. Prevention of the caught exception from leaving the catch block
a. Allowing the original exception to propagate after it has been caught, with all of the information (including context) intact
a. Wrapping the caught exception inside a newly created exception of a different type
a. Generating a new exception with no information about the original exception
a. Altering the Message , TargetSite and/or StackTrace, of the existing exception before re-throwing
46. Which of the following is not a standard service behavior supported by the System.ServiceProcess.ServiceController class members?
Answers:
a. Start
a. Continue
a. Pause
a. Restart
47. In which of the following ways do structs differ from classes?
Answers:
a. Structs can not implement interfaces
a. Structs cannot inherit from a base struct
a. Structs cannot have events interfaces
a. Structs cannot have virtual methods
48. Which of the following are true about enums?
Answers:
a. Enums are always equated to an integral constant value
a. A variable of the enum type will always contain one of the declared symbolic constants
a. The declared values of an enum are always assigned sequential starting with 0
a. The declared values of an enum must be mapped (explicitly or implicitly) to unique integral values
49. Which of the following are characteristics of the System.Threading.Timer class?
Answers:
a. The method provided by the TimerCallback delegate will always be invoked on the thread which created the timer.
a. The thread which creates the timer must have a message processing loop (i.e. be considered a UI thread)
a. The class contains protection to prevent reentrancy to the method provided by the TimerCallback delegate
a. You can receive notification of an instance being Disposed by calling an overload of the Dispose method.
50. Custom non-fatal exceptions should be derived from:
Answers:
a. ApplicationException
a. DataMisalignedException
a. ExecutionEngineException
a. SystemException
51. Which of the following are defined as a “token”?
Answers:
a. Identifier
a. Whitespace
a. Punctuator
a. Operator
a. All of the above
52. Of which elements does Generics allow parameterization by type?
Answers:
a. Classes
a. Structs
a. Methods
a. Fields
53. To which of the following can System.IO.IsolatedStorage not be scoped?
Answers:
a. Restricted to a Specific Application
a. Restricted to a Specific AppDomain
a. Restricted to a Specific User
a. Restricted to a specific Physical Media
54. When using the Demand method of System.Security.IPermission, which of the following will occur?
Answers:
a. The permissions of the code which invoked the Demand method will be evaluated.
a. For permissions which do a stack walk, an exception will occur only if NONE of the calling codes has the required permission
a. For permissions which do a stack walk, an exception will occur if ANY of the calling codes does not have the required permission
a. The permission levels of individual stack frames are always checked regardless of the permission type.
55. Which of the following are true about event handling?
Answers:
a. One method may handle events from different sources
a. A single event can be handled by multiple methods
a. Event handlers can be dynamically added and removed at runtime
a. All of the above
56. Which of the following conditions are true regarding System.Diagnostics.Trace?
Answers:
a. Trace is enabled for both Release and Debug initial configurations
a. Trace can be controlled both by preprocessor directives, and compiler directives
a. To change the severity levels which generate output, you must recompile your program
a. All of the Above
57. Parameterized Properties in C# are__________.
Answers:
a. not supported except for implementing an indexer.
a. properties which take one or more parameters (e.g. to retrieve one element from a member collection)
a. properies which use one or more attributes to control their behavior
a. properties which can be passed as Method Parameters so they can be invoked by the called method.
58. Which System.Runtime.Remoting class is used store all relevant information required to generate a proxy in order to communicate with a remote object?
Answers:
a. ObjRef
a. MarshalByRefObject
a. ObjectHandle
a. RemotingServices
59. Determining the availability of sufficient memory for an operation can be accomplished by?
Answers:
a. There is no supported application level means to determine if a specific amount of memory is available.
a. using static methods of System.Runtime.MemoryFailPoint and checking the return value
a. creating an instance of System.Runtime.MemoryFailPoint and monitoring for an InsufficientMemoryException
a. creating an instance of System.Runtime.MemoryFailPoint and monitoring for an OutOfMemoryException
60. Which of the following is not an application entry point?
Answers:
a. public static void Main() {}
a. public static int Main() {}
a. public static int Main(string[] args) {}
a. public static int Main(string cmdline) {}
a. private static int Main(string[] args) {}
61. What will be the output generated by the following code?
string t = “This Is a Test”;
Answers:
a. public Sample() : this(1) { }
a. public Sample() : Sample(1) {}
a. Both the above.
a. One class constructor can not directly access another constructor
38. Which of the following code samples will cause a compilation error?
Answers:
a. class SampleClass {} class SampleClass {}
a. class SampleClass {} class SampleClass<T,U> {}
a. class SampleClass where T : class { } class SampleClass where T : struct { }
a. class SampleClass {} class SampleClass where T : class { }
39. Which of the following are true about statements?
Answers:
a. A while statement will always execute its body at least once.
a. A for loop will always execute its body at least once.
a. A try statement must always include at least one catch block
a. A case clause within a switch statement may not fall through to the next case clause
40. If two assemblies contain the same fully qualified class, which of the following will be true?
Answers:
a. It is impossible to add a reference to both assemblies to any given assembly
a. A new root can be added to the assemblies namespace hierarchy by the use of an extern alias
a. The specific colliding name may be altered by using an extern alias
a. The collision may be avoided by using a statement to provide an alias
41. Which of the following are true about delegates?
Answers:
a. A delegate requires an instance method be supplied.
a. A delegate instance may encapsulate only one method
a. Delegates are not typesafe
a. A delegate instance does not know or care about the class type of the encapsulated method
42. When Deleting a DataRow from the DataRowCollection of a DataTable, you can:
Answers:
a. use the DataRowCollection.Remove method to immediately delete the row.
a. use the DataRowCollection.Remove method to mark the row for deletion when DataRow.AcceptChanges is called.
a. use the DataRow.Delete method to immediately delete the row.
a. use the DataRow.Delete method to mark the row for deletion when DataRowAcceptChanges is called.
43. Which of the following is NOT a requirement for an application to be certified in the “Certified for Windows Program”?
Answers:
a. Usage of system settings for size, color, and font
a. Support for Windows “High Contrast” option
a. Usage of sound to notify of critical information
a. Keyboard only access to all features including menus, and controls
44. Which access limitation does a class member declared protected internal have?
Answers:
a. Access is limited to the containing class plus any classes derived from the containing class
a. Access is limited to the current assembly
a. Access is limited to the containing class plus any classes derived from the containing class that are also in the current assembly
a. Access is limited to the containing class plus any classes derived from the containing class or any other class in the current assembly
45. Which of the following operations can NOT be performed inside a catch block?
Answers:
a. Prevention of the caught exception from leaving the catch block
a. Allowing the original exception to propagate after it has been caught, with all of the information (including context) intact
a. Wrapping the caught exception inside a newly created exception of a different type
a. Generating a new exception with no information about the original exception
a. Altering the Message , TargetSite and/or StackTrace, of the existing exception before re-throwing
46. Which of the following is not a standard service behavior supported by the System.ServiceProcess.ServiceController class members?
Answers:
a. Start
a. Continue
a. Pause
a. Restart
47. In which of the following ways do structs differ from classes?
Answers:
a. Structs can not implement interfaces
a. Structs cannot inherit from a base struct
a. Structs cannot have events interfaces
a. Structs cannot have virtual methods
48. Which of the following are true about enums?
Answers:
a. Enums are always equated to an integral constant value
a. A variable of the enum type will always contain one of the declared symbolic constants
a. The declared values of an enum are always assigned sequential starting with 0
a. The declared values of an enum must be mapped (explicitly or implicitly) to unique integral values
49. Which of the following are characteristics of the System.Threading.Timer class?
Answers:
a. The method provided by the TimerCallback delegate will always be invoked on the thread which created the timer.
a. The thread which creates the timer must have a message processing loop (i.e. be considered a UI thread)
a. The class contains protection to prevent reentrancy to the method provided by the TimerCallback delegate
a. You can receive notification of an instance being Disposed by calling an overload of the Dispose method.
50. Custom non-fatal exceptions should be derived from:
Answers:
a. ApplicationException
a. DataMisalignedException
a. ExecutionEngineException
a. SystemException
51. Which of the following are defined as a “token”?
Answers:
a. Identifier
a. Whitespace
a. Punctuator
a. Operator
a. All of the above
52. Of which elements does Generics allow parameterization by type?
Answers:
a. Classes
a. Structs
a. Methods
a. Fields
53. To which of the following can System.IO.IsolatedStorage not be scoped?
Answers:
a. Restricted to a Specific Application
a. Restricted to a Specific AppDomain
a. Restricted to a Specific User
a. Restricted to a specific Physical Media
54. When using the Demand method of System.Security.IPermission, which of the following will occur?
Answers:
a. The permissions of the code which invoked the Demand method will be evaluated.
a. For permissions which do a stack walk, an exception will occur only if NONE of the calling codes has the required permission
a. For permissions which do a stack walk, an exception will occur if ANY of the calling codes does not have the required permission
a. The permission levels of individual stack frames are always checked regardless of the permission type.
55. Which of the following are true about event handling?
Answers:
a. One method may handle events from different sources
a. A single event can be handled by multiple methods
a. Event handlers can be dynamically added and removed at runtime
a. All of the above
56. Which of the following conditions are true regarding System.Diagnostics.Trace?
Answers:
a. Trace is enabled for both Release and Debug initial configurations
a. Trace can be controlled both by preprocessor directives, and compiler directives
a. To change the severity levels which generate output, you must recompile your program
a. All of the Above
57. Parameterized Properties in C# are__________.
Answers:
a. not supported except for implementing an indexer.
a. properties which take one or more parameters (e.g. to retrieve one element from a member collection)
a. properies which use one or more attributes to control their behavior
a. properties which can be passed as Method Parameters so they can be invoked by the called method.
58. Which System.Runtime.Remoting class is used store all relevant information required to generate a proxy in order to communicate with a remote object?
Answers:
a. ObjRef
a. MarshalByRefObject
a. ObjectHandle
a. RemotingServices
59. Determining the availability of sufficient memory for an operation can be accomplished by?
Answers:
a. There is no supported application level means to determine if a specific amount of memory is available.
a. using static methods of System.Runtime.MemoryFailPoint and checking the return value
a. creating an instance of System.Runtime.MemoryFailPoint and monitoring for an InsufficientMemoryException
a. creating an instance of System.Runtime.MemoryFailPoint and monitoring for an OutOfMemoryException
60. Which of the following is not an application entry point?
Answers:
a. public static void Main() {}
a. public static int Main() {}
a. public static int Main(string[] args) {}
a. public static int Main(string cmdline) {}
a. private static int Main(string[] args) {}
61. What will be the output generated by the following code?
string t = “This Is a Test”;
t.Replace(“T”, “?”);
Console.WriteLine(t);
Answers:
a. ?his Is a ?est
a. ?his Is a ?es?
a. This Is a Test
a. ?his Is a Test
62. Which of the following does NOT apply to XCOPY deployment?
Answers:
a. The appropriate version of the .NET framework must be installed.
a. All application components must be in the application directory, or a subdirectory.
a. Shared components can be installed as part of the XCOPY.
a. XCOPY deployment to a non-empty target directory may have unintended side-effects
63. Which of the following are true about operator precedence?
Answers:
a. The Conditional Operator (?:) has the lowest precedence.
a. All binary operators are left-associative, and evaluate from left to right.
a. The Assignment and Conditional Operators are right-associative.
a. The Conditional And (&&) and Or (||) operators have higher precedence than the Logical And (&) and Or (|) operators.
64. Which of the following encodings are NOT supported by classes in the System.Text namespace?
Answers:
a. ASCII
a. Unicode
a. UTF-7
a. UTF-8
a. EBCDIC
65. Which of the following can Interfaces contain?
Answers:
a. Methods
a. Properties
a. Fields
a. Conversion operators
a. Events
66. Which of the following is a primary characteristic of System.Xml.XmlDataDocument?
Answers:
a. It provides synchronized operations viewing the content either as an XmlDocument or as a DataSet
a. It provides the basic abilities for XMLDocument instances to be created from or exported to DataSets
a. It provides a limited set of capabilities compared to the System.Xml.XmlDocument class
a. It provides the basic abilities to allow DataSets to be loaded from or exported to XML files.
Answers:
a. ?his Is a ?est
a. ?his Is a ?es?
a. This Is a Test
a. ?his Is a Test
62. Which of the following does NOT apply to XCOPY deployment?
Answers:
a. The appropriate version of the .NET framework must be installed.
a. All application components must be in the application directory, or a subdirectory.
a. Shared components can be installed as part of the XCOPY.
a. XCOPY deployment to a non-empty target directory may have unintended side-effects
63. Which of the following are true about operator precedence?
Answers:
a. The Conditional Operator (?:) has the lowest precedence.
a. All binary operators are left-associative, and evaluate from left to right.
a. The Assignment and Conditional Operators are right-associative.
a. The Conditional And (&&) and Or (||) operators have higher precedence than the Logical And (&) and Or (|) operators.
64. Which of the following encodings are NOT supported by classes in the System.Text namespace?
Answers:
a. ASCII
a. Unicode
a. UTF-7
a. UTF-8
a. EBCDIC
65. Which of the following can Interfaces contain?
Answers:
a. Methods
a. Properties
a. Fields
a. Conversion operators
a. Events
66. Which of the following is a primary characteristic of System.Xml.XmlDataDocument?
Answers:
a. It provides synchronized operations viewing the content either as an XmlDocument or as a DataSet
a. It provides the basic abilities for XMLDocument instances to be created from or exported to DataSets
a. It provides a limited set of capabilities compared to the System.Xml.XmlDocument class
a. It provides the basic abilities to allow DataSets to be loaded from or exported to XML files.
No comments:
Post a Comment