Ensurepass  Question 121 What are the steps required to read text from a file?     Correct Answer:     Question 122 Which element is NOT required if you need a custom class to raise an event?   A method to add an event handler A class containing event data, derived from EventArgs A delegate for the event A class raising the event   Correct Answer: A     Question 123 Which class is used to write primitive types in binary to a stream and supports Read more [...]
EnsurepassQuestion 101 You create an XML document that has an XmlNode named node1. Which code fragment will read the XML contained in node1 and its subnodes?   Node1.ToString (); Node1.OuterXml; Node1.InnerXml; Node1.InnerXext; Node1.Value; Correct Answer: B     Question 102 You need to find out whether the active Windows user of an application is a member of the Administrators group. Which permission class should you use?   SecurityPermission PrincipalPermission PublisherIdentityPermission Read more [...]
EnsurepassQuestion 111 Which describes an interface?   Allows managed code to access unmanaged code. Contains code that implements properties, methods, and events. A template that defines a set of properties, methods, and events. Can be changed after it has been published.   Correct Answer: C     Question 112 Which type of casting enforces type safety?   Reinterpret Implicit static Explicit static Explicit dynamic   Correct Answer: B     Question Read more [...]
EnsurepassQuestion 91 Which three characteristics define the identity of an assembly? (Each correct answer presents part of the solution. Choose three.)   Simple text name File size File creation date Culture information Version number   Correct Answer: ADE     Question 92 .NET managed code compiles into:   Assembly language. Common Intermediate Language (CIL). Extensible Application Markup Language (XAML). Machine code.   Correct Answer: B     Question Read more [...]
EnsurepassQuestion 71 You create a custom exception class named MyCustomException that is derived from ApplicationException. Which code segment should you use to raise MyCustomException?                   Correct Answer: B     Question 72 Custom event delegates are used to:   Raise one or more custom events Handle errors generated in a try block. Route events to one or more event handlers. Process mouse clicks or keyboard Read more [...]
EnsurepassQuestion 81 You need to force an immediate garbage collection of all unused memory. Which method should you use?   WaitForFullGCComplete SuppressFinalize CollectionCount Collect Correct Answer: D     Question 82 Where is dynamic memory allocated?   Text segment Code segment Stack Heap   Correct Answer: D     Question 83 You need to configure security policy for the following policy levels:   Machine User Enterprise   Which .NET Read more [...]
EnsurepassQuestion 61 You create an ArrayList object. You need to ensure that only objects of the System.DateTime type can be added to the collection. What should you do?   Use a Hashtable collection. Use the ToString() method on objects that you add to the ArrayList. Use a List<T> collection. Restrict the ArrayList variable to a capacity of 16 items.   Correct Answer: C     Question 62 Which code segment prevents the class named Final from being inherited?   Read more [...]
EnsurepassQuestion 51 Which two types of actions can trigger an event? (Each correct answer presents a complete solution. Choose two.)   User intervention, such as a mouse click. Some other program logic, such as a call to the program module. Declaring the signature of the delegate. Adding a delegate keyword.   Correct Answer: AC     Question 52 You need to handle only SqlException exceptions. You also need to ensure that any other exception flows back to the calling code. Read more [...]
EnsurepassQuestion 41 Type-safe code accesses only the memory locations:   It is authorized to access. Of objects on the heap. Of objects that are static or shared. Of objects on the stack.   Correct Answer: A     Question 42 A type-safe language prevents:   Access to arbitrary memory locations. Memory leaks. Null reference exceptions. Division by zero exceptions.   Correct Answer: A     Question 43 How does managed .NET code use an unmanaged COM Read more [...]
EnsurepassQuestion 31 You need to retrieve an assembly's Version property. Which class should you use?   AssemblyName MemberInfo Assembly OperatingSystem   Correct Answer: A     Question 32 You have created a program that writes status updates into a file. You want to modify the file. You need to ensure that other users can view the file while it is being modified. Which permission should you use to open the file?   FileAccess.Write FileShare.Inheritable FileShare.Read Read more [...]
EnsurepassQuestion 21 Which two actions should you perform to consume events defined in another class? (Each correct answer presents part of the solution. Choose two.)   Define a method that raises the event. Set the current class as a sealed class. Place a reference to the consuming class in the class that raises the event. Match the signature of the delegate declared for the event. Define an event handler method. Correct Answer: DE     Question 22 In which folder should you Read more [...]