Thứ Tư, 21 tháng 8, 2013

Advance C#

1.     ___________ is phrase for complications that arise while working dynamic link library [1.0]
1.     DLL hell           b. DLL API                    c. DLL HLL                    d. DLL Error
2.     C# programming language provides the users with an altogether separate namespace called ___________ for file and stream handling? [1.0]
1.     System.UI         b. System.API               c. System.IO                d. System.InputOutput
3.     The statics methods of the ________ class do a security check on all methods? [1.0]
1.     File                  b. FileInfo                     c. Directory                   d. DirectoryInfo
4.     If a part of code is accessed by the multiple of threads at the same time it is known as a__________ section [1.0]
1.     Critical             b. immutable                 c. mutable                     d. thread-safe
5.     The____________ property of Thread class defines the state of a thread during it execution [1.0]
1.     Threadexcute                b. Thread          c. Threadstatus             d. ThreadState
6.     A newly created thread originated from the __________ state and remain in that state until the __________ method is invoked [1.0]
1.     Running, Start   b. WaitSleepJoin, Join   c. Start, Join                 d. Unstarted, Start

7.     A _________ object can be requested by both, the COM and .NET clents, at the same time [1.0]
1.     managed          b. reference                  d. runtime                     d. unmanaged

8.     _________ is the tool using which assemblies can be deployed, uninstalled, manipulated and viewed [1.0]
1.     gacutil.exe                   b. gac.exe                    c. assemblytool.exe      d. deploy.exe

9.     Which one of the following statements is not a restriction for declaring conditional methods? [1.5]
1.     This method must be an implementation of an interface method.

10.  Can you identify the correct order of steps to create to resource file ? [1.5]
1.     Move to a drive on the system where the .txt file is present
2.     Type Resgen filename.txt
3.     Open Visual studio 2005 command prompt
4.     Create text file with required date and save it in the local system

1.     1, 2, 3, 4           b. 2, 4, 1, 3                   c. 3, 1, 4, 2                   d. 4, 3, 1, 2

11.  Which of the following statements about the methods of File are correct? [1.5]
1.     The Create method is used to create a file in the specified class
2.     The Delete method is used to delete a file in the specified class
3.     The GetAttributes method is used to get the file attributes of the file
4.     The GetCreationTime method is used to verify whether a file with the specified name exists in the specified path

12.  Can you identify the correct order of steps to use components directly from .NET [1.5]
1.     Select the component from the list
2.     Click the COM tab in the Add Reference dialog box
3.     Add a reference to the project using project “Add Reference”
4.     Click OK to create RCWs for the selected type library object
1.     1, 2, 3, 4                       b. 2, 3, 4, 1                   c. 3, 2, 1, 4                   d. 4, 3, 2, 1

13.  Can you identify the two ways by which managed code can directly unmanaged code? [1.5]
1.     Call a function exported directly from a DLL
2.     Call interface exported directly from a DLL
3.     Call a function on a COM object
4.     Call an interface method on a COM object

14.  The ____________ class presentes an attributes and its value in DTD while the ____________ class defines a reader that provides forward-only access to XML  data [1.5]
1.     XmlAttribute, XmlReader
2.     XmlDocument, XmlWriter
3.     XmlReader, XmlAttribute
4.     XmlWriter, XmlDocument

15.  Can you identify the correct of  steps to create a multi-file assembly using .NET? [1.5]
1.     Create a source code
2.     Save and compile the source code into .net module
3.     Use csc to assemble the modules and main resource file into a single assembly
4.     Create a main source file
a.     1, 2, 3, 4           b. 1, 2, 4, 3                   c. 1, 4, 3, 2                   d. 4, 1, 3, 2

16.  Can you identify the correct of steps to add a resource file to a project? [1.5]
1.     Open Visual Studio 2005 IDE
2.     Create a project and right click on a project name
3.     Select a resource file, click Add and then set the Bulid Action property of the reource file to Embedded Resource
4.     Select Add from the menu and then Exitsting  item option
a.     1,  2, 3, 4                      b. 1, 2, 4, 3                   c. 1, 4, 3, 2                   d. 4, 1, 3, 2

17.  The C# ___________attribute allows you to control whether a method should be called.

a. built_in          b.custom          c.Conditional               d.DLLimport          

18.  The C#____________attribute allows you to invoke unmanaged code in a C program.
a. built_in          b.custom          c.Conditional                 d.DLLimport           

19.  _________is used only to generate and register a type library with COM.
a. Regasm.exe  b.Regsm.exe                c.TLbexp.exe                d.TLbimp.exe

20.  The two important methods in Memberinfo class are ___________
a.     GetAttributes() and GetType()
b.    GetCustomAttributes() and GetType()
c.     Get() and GetType()
d.    CustomAttributes() and GetType()
   
21.  Which of the following statements about System.IO namespace classs are incorrect?
a.     The BinaryReader class reads primitive data types as binary values in a specific encoding
b.    The DirectoryInfo Class provides methods for creating, moving and enumerating through directories and sub-directories.
c.     The File class contains methods that are common to file and directory manipulation.
d.    The Stream represents a writer that can write a sequence of characters.
 
22.  Can you indentify the correct order of steps followed when Pinvoke calls an unmanaged function?
1.     The address of the function is located.
2.     The function arguments are pushed onto the stack.
3.     The DLL containing the function is located.
4.     The DLL is loaded into the memory.
a.1,2,3,4           b.1,3,2,4           c.3,2,1,4           d.3,4,1,2

23.  Which one of the following correctly represents the four parts contained in an assembly?
a.     Assembly Name, Type Metadata, MSIL Code and Resources.
b.    Assembly Metadata, Type Metadata, MSIL Code and Resources.
c.     Class Name, Type Metadata, MSIL Code and Resources.
d.    Type Metadata, MSIL Code,EXE files and Resources.

24.  ______can be implied simply as a collection of information existing in binary form in a Portable Executable file or a .NET assembly.
a.     Assembly Metadata                     b. Type Metadata          c. MSIL Code                d. Resources

25.  The______ class in the System.IO namespace contains methods that are common to file and directory manipulation.
a.     FileSystemInfo                b. DirectoryInfo c. FileInfo                     d. Stream

26.  The___ method of File class is used when you want to delete a file.
a.     Delete() with the path of the file specified as a parameter.                        c. Remove
b.    Delete() without any parameters.                                                    d. Erase

27.  Can you rearrange the steps to simulate the process the compiler uses to determine how to apply the attribute?
1.     Checks for a named parameter.
2.     Sets the field or property to a named parameter value.
3.     Searches for the attribute class.
4.     Checks for a constructor in the attribute
5.     creates an instance of the object.
6.     Checks the scope of the attribute.
a.1,2,3,4,5,6,7               b. 2,4,5,6,7,1,3              c. 3,6,4,5,1,2,7  d. 7,6,3,4,5,1,2

28.  The____ class provides static methods for the creation, copying, deletion, moving and opening of files.
a.     BinaryReader                    b. BinaryWriter  c. File               d. FileInfo

29.  Can you indentify the correct order of steps to create a thread?
1.     Define a class
2.     Create one or more Thread objects in the new Class
3.     Define a method inside the class
4.     Create one or more objects of the class in a new class
5.     Start the execution of the threads
a.     1,4,3,2,5               b.1,2,3,4,5                    c. 1,3,4,2,5                    d. 1,3,2,4,5

30.  Which of the following statement about Pinvoke are valid?
a.     Unmanaged DLL function are made available to manage client code with the help of Pinvoke.
b.    Pinvoke can access global exported DLL functions.
c.     PInvoke provides support to marshal CLR data types and native data types.
d.    Pinvoke works only with C# code and not any other .NET programming language.

31.  Which of the following statements about thread pooling in .NET are true?
a.     The TheadPool class helps to provide a ready set of worker threads in a pool from which one or more can be chosen for any short task.
b.    Using the threadPool class, thread management is done by the system.
c.     Without thread pooling, it is cumbersome and unsafe for a developer to manage and maintain threads.
d.    The threads in the pool are unmanaged threads.

32.  Which of the following operations can be performed by using the DirectoryInfo?
a.     Create, and delete directories only
b.    Create, move, and delete directories
c.     Delete files only
d.    Move and delete directories only

33.  Which of these namespaces must be imported in order to work with DLLimport attribute?
a.     System.Runtime
b.    System.Runtime.InteropServices
c.     System.IO
d.    System.Data

34.  The______ attribute is used to describe how an attribute class can be used.
a.     AttributeUsage                 b. Attribute                    c. AttributeData d. AttributeInfo

35.  The process of retrieving information that is held in metadata using .NET runtime is called_____.
a.     Reflection                        b. Interoperability                      c. Attribute                    d. Casting

36.  Which of the following class enables you to add image files and other types of resource files to an assembly?
a.     ResourceWriter                 b. Resource                              c. Writer                        d. FileStream

37.  Can you indentiy the correct order of steps to write an XML file using .NET?
1.     Write the XML declaration
2.     Add the start and End elements
3.     Declare an XmlTextWriter object
4.     Write the value of the element
5.     Close the file
6.     Flush the file
a.     1,2,3,4,5,6            b. 3,1,2,4,6,5                 c. 1,5,6,3,2,4                 d. 1,6,5,3,2,4

38.  Which of the following statements about private assemblies are valid?
a.     Private assemblies can be deployed using XCOPY or using drag and drop in Windows Explorer.
b.    A private assembly is deployed in an application for exclusive use in that application.
c.     It is not necessary that private assemblies can be accompanied by the assembly manifest.
d.    Private assemblies not be registered.

39.  Which of the following is not a valid member of the ThreadPriority enumeration?
a.     Highest                b. AboveNormal                        c. Normal                      d. Medium.      


Không có nhận xét nào:

Đăng nhận xét