Sunday 25 March 2012

Test 04 - Reflection, Custom Attributes, Threading, Windows Services


.Net Framework and C# Basics - Test No : 01 

 Test Number:2 Topics :Assembly, Event, Delegates_exceptions


 Test 04 - Reflection, Custom Attributes, Threading, Windows Services
_________ class contains information that governs the use of the attribute
a) System.Reflection
b) System.Attribute
c) System.Threading
d) System.IO
The attribute class  specify the types of program elements to which the attribute can be applied by _____
a) Getcustomattribute
b) Attributeusage
c) AttributeTargets property
d)  Allowmultiple
The attribute class specify whether it is legal for the attribute to be applied more than once
 to the same program element by ___________
a) Attributeusage
b) Allowmultiple
c) Inherited
d) AttributeTargets
The primary purpose of _________ is to identify the types of program elements to which you
r custom attribute can be applied.
a) Attributeusage
b) Allowmultiple
c) Inherited
d) AttributeTargets
_________  are the common ways of obtaining a Type reference that refers to any given type
a) "typeof" operator
b) GetType()
c) static GetType()
d) All of the above
Assembly' class comes from namespace ______________.
a) System.Assembly
b) System.Attribute
c) System.Threading
d) System.Reflection
_________ class is used only to hold the reference to a type
a) TypeCode
b) Type
c) TypedReference
d) TypeDelegator
Which method is used to get all the methods of a Type
a) GetMethods
b) GetMethod
c) GetMembers
d) None of the above
A _______ is an independent stream of instructions in a program
a) Thread
b) Application
c) Processor
 d) Process

Threads are manipulated using the _______ class, which can be found in the System.Threading name - space.
a) Thread
b) ThreadPool
c) ThreadPriority
d) ThreadStart

To indicate the entry point of the thread, one need to use _____________ delegate from
 System.Threading name- space
a) MethodInvoker
b) ThreadExcetionEventHandler
c) ThreadStart
d) ThreadBegin

We can pass value to the thread if it takes______________as parameter in the constuctorr
a) ThreadStart
b)  Threadparameter
c) ParameterizedThreadStart
d) None of the above

One can wait for a thread to terminate by calling the _____ method
a) Suspend()
b) sleep()
c) wait()
d) join()

__________ these are the thread priorities
a) Highest
b) AboveNormal, Normal
c) BelowNormal, Lowest
d) All of the above

A ___________ is a bug that can occur when two threads have to access resources that
 are locked each other
a) deadlock
b) lock
c) RaceConditions
d) Threadpool

_______ rarely halts execution of a process, but it can lead to data corruption
a) deadlock
b) lock
c) RaceConditions
d) Threadpool

Which technique is used to read the metadata from Assembly?
a) Reflection
b) Globalization
c) stream reader
d) AssemblyReader

  Which property we need to set to run the service automatically whenever machine gets start?
a) AutoClear
b) ClearStart
c) AutoStart
d) ClearBegin

Threads are manipulated using the Thread class, which can be found in the _____________ name- space.
a) System.Threading
b) System.Runtime.Threading
c) System.Thread
d) System.Threading.Runtime

For stopping the thread_________ method is used
a) Suspend()
b)  Resume()
c) Abort()
d) All of the above

Synchronization can be done with the help of ________ statement
a) deadlock
b) lock
c) RaceConditions
d) Threadpool
Thread cannot be terminated when it is in ________________
a) CriticalRegion
b) locked code
c) Deadlocked Code
d) All of the above

What’s the UNIX name for a Windows service equivalent?
a) Thread
b) Service
c) Deamon
d) DVIPS

When developing a Windows service for .NET, which namespace do you typically look in
 for required classes?
a) System.WinProcess
b) System.ServiceProcess
c) System.WindowsService
d) None of the above

_____________is the command line utility used to register the windows service.
a) installutil
b) installver
c) installser
d) installwinserv

No comments :