Deck 2 Flashcards
Which core technology allows interoperability between Microsoft Visual Basic .NET code and C# code?
Microsoft Intermediate Language (MSIL)
What is an advantage of strongly typed code languages like .NET?
Capturing of errors during compilation.
You need to suspend the current thread until all Finalize() methods have been processed. Which garbage collection method should you use?
Dispose
Which feature is automatically handled in managed code but must be explicitly handled in unmanaged code?
Memory Disposal
You want to access a native Win32 function from a .NET application. You import the function. Which two keywords should you use to define the function? (Each correct answer presents part of the solution. Choose two.)
Extern
—–AND—–
Public
A class named Student is contained inside a namespace named Contoso.Registration. Another class named Student is contained inside a namespace named Contoso.Contacts. You need to use both classes within the same code file. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.) Add the following line of code on the top of the code file:
Using Contoso;
Refer to the classes by using the Student class wrapped within the regions named
Registration and Contacts.
———–
Add the following lines of code on the top of the code file:
Using Contoso.Contacts;
Using Contoso.Registration;
Refer to the classes by using the Student class.
Which describes the effect of applying the protected accessibility modifier to a method?
The method is available to all classes derived from the declaring class.
You want to create a class named ShoppingCart that has a type argument named TItem. The TItem type argument must be a value type. Which code segment should you use to define the ShoppingCart class?
public class ShoppingCart Where Titem : struct { //do something }
You create a class library named Contoso.Business. The library is used in a Windows application named Contoso.Ui. In which file should you store application configuration settings during deployment?
Contoso.Ui.config
Which is the base class of all classes in the .NET Framework?
System.Object
You want to raise a custom exception. Which keyword should you use?
Throw
What is the purpose of the app.config file?
To configure the version of .NET targeted by the application.
What is the characteristic of a delegate?
An object that raises an event
You write code that reads a file from the disk. Which exception will catch an error if the file is missing?
IOException
Which file contains the required .NET settings for an ASP.NET web application?
Web.config