1. Which of the following are static methods of the System.Reflection Activator class? Answers:
llowing code will be: string t = “This Is a Test”; t.Replace(“T”, “?”); Console.WriteLine(t); Answers:
- CreateComInstanceFrom<
- CreateInstanceFrom
- GetInstance
- CreateInstance
- All of the above
- They must be declared static
- They can be declared either static or instance members
- They must be declared in the same assembly (but may be in different source files)
- Extension methods can be used to override existing instance methods
- Extension methods with the same signature for the same class may be declared in multiple namespaces without causing compilation errors
- The DataReader provides a cursor that can be used to move forward and backwards through the result.
- The DataReader provides random access capabilities on the result.
- The Application code can reference the first row of a multi-row result set faster than it can be by loading it directly into a DataTable
- The DataReader can provide the Schema of the result to the application code.
- Document-centric workflows
- Human workflows
- User-interface page flows
- Builtin support for communications across multiple applications and/or platforms
- The connection to the database must remain valid for the life of the data objects
- All tables in a dataset must come from the same database.
- A given instance of a DataTable can be in only one DataSet
- Changes made to multiple tables within a DataSet can easily be transferred to a new DataSet which contains only the changes
- Content from multiple DataSets can easily be combined into a single DataSet that contains the net result of all changes.
- Objects must be set to null in order to be eligible for garbage collection
- Unless specific steps are taken, an object may be moved in memory
- Objects become eligible for garbage collection as soon as it is impossible for any code to access them
- Objects which implement finalizers will always have the finalizer called at some point
- int
- double
- string
- long
- float
- The Collection Class must implement System.Collections.Generic.ICollection<T>
- The Collection Class must implement System.Collections.Generic.IList<T>
- Each of the Items in the Initializer List will be passed to the Add<T>(T item) method
- The items in the initializer will be treated as an IEnumerable<T> and passed to the collection constructor+K110
- It provides readable names for both regular time and, if appropriate, daylight savings time
- It provides a means of enumerating the known time zones that are available on the local system
- It provides functionality to create custom time zones
- It provides the period the time zone was in effect for. For example: From 1986 to 2006, it was observed from the first Sunday in April to the last Sunday in October, but since 2007, it is being observed from the second Sunday in March to the first Sunday in November
- provide a means to rollback a failed transaction
- provide a means to undo a successfully committed transaction later
- provide a means to terminate an in process transaction
- achieve load balancing by adapting to the current activity
- Classes
- Structs
- Methods
- Events
- Fields
- More concise syntax
- The types for a Lambda Expression may be omitted
- The body of an anonymous method can not be an expression
- Lambda Expressions permit deferred type interference, that anonymous methods do not
- All of the above
- Console Applications
- Windows Forms based Applications
- Windows Presentation Foundation based Applications
- ASP.NET based applications
- All of the above
- <exception>
- <code>
- <summary>
- <events>
- System.DateTime
- System.TimeSpan
- System.Globalization.Calendar
- System.Globalization.CultureInfo
- HashSet is an unordered collection.
- HashSet requires that each element be unique a
s determined by either a supplied EqualityComparer or the default EqualityComparer - Operations on sets (Union, Intersection, etc) always create new result sets
- HashSet provides functionality for “conceptual sets” where the rules for membership can be specified without actually creating all of the items.
- It is optimized for single processor/core operations
- It is optimized for usage where writes from multiple sources are common
- A thread which has a read lock on a resource may not acquire a write lock on the same resource
- By default, a thread which has a read lock on a resource and attempts to get another read lock on the same resource will throw an exception
- System.Threading.Timer 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.
- 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 System.Windows.Forms.Timer instances.
- System.Windows.Forms.Timer Lower Resolution timer which requires a UI message pump on the creating thread.
- All of the above
- It adds properties for direct access to both the Key and the Value
- It is optimized to handle the structure of a Dictionary.
- It provides properties to determine if the Dictionary is enumerated in Key or Value order
- It provides reverse lookup methods to distinguish a Key from a specific Value
- Information must be explicitly converted to/from a byte stream before it uses the MessageQueue class
- Invoking the MessageQueue.Send member defaults to using the System.Messaging.XmlMessageFormatter to serialize the object.
- Objects must be XMLSerializable in order to be transferred over a MessageQueue instance.
- The first entry in a MessageQueue must be removed from the queue before the next entry can be accessed
- Entries removed from a MessageQueue within the scope of a transaction, will be pushed back into the front of the queue if the transaction fails.
- The actual type is determined at compilation time, and has no impact on the runtime
- The actual type is determined at runtime, and late binding takes effect
- The actual type is based on the native VARIANT concept, and no binding to a specific type takes place.
- “var” itself is a specific type defined by the framework, and no special binding takes place
- You can request that the garbage collector process a generation if it determines that it is appropriate at specific points in your code
- You can control the intrusiveness of the garbage collector (i.e. how often it performs collections) while your program is running
- You can control the intrusiveness of the garbage collector (i.e. how often it performs collections) only during application initialization
- You should specify LowLatency when using Concurrent Server Garbage Collection to improve memory utilization
- Assignment (=)
- Conditional (&&,||)
- Logical (&,|,^)
- Shift (<<, >>)
- Interprocess communication through anonymous and/or named pipes.
- Access to named pipes using System.IO.Stream
- Access to system level pipe security implemented as discretionary access control lists (DACL) and/or system access control lists (SACL),
- Asynchronous read and write operations
- All of the above
- Expression trees are a data structure which can be initially composed using language syntax.
- Expression trees are dynamically generated code which is executed to perform the desired function.
- Expression trees can only be created from Lambda Expressions
- Expression trees can be modified once they are created
- All of the Above
- ServiceContract
- OperationContract
- DataContract
- MessageContract
- ADO.NET provides significantly better performance.
- ADO.NET is better suited for communications between disparate systems/applications.
- ADO.NET can eliminate the need for COM components in the communication layer.
- DNA makes it easier to communicate across firewalled boundaries.
- use the DataRowCollection.Remove method to immediately delete the row.
- use the DataRowCollection.Remove method to mark the row for deletion when DataRow.AcceptChanges is called.
- use the DataRow.Delete method to immediately delete the row.
- use the DataRow.Delete method to mark the row for deletion when DataRowAcceptChanges is called.
- They must handle case-sensitivity identically in both the GetHashCode() and Equals() methods.
- Key objects must be immutable for the duration they are used within a HashTable.
- 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.
- Each Element in a HashTable is stored as a Key/Value pair of the type System.Collections.DictionaryElement
- All
of the above
- Bringing various existing communication technologies into a unified environment.
- Cross vendor/platform communication.
- Support for asynchronous communications.
- Support for distributed applications based on technologies such as MSMQ and/or COM+
- All of the above
- Access is limited to the containing class plus any classes derived from the containing class
- Access is limited to the current assembly
- Access is limited to the containing class plus any classes derived from the containing class that are also in the current assembly
- Access is limited to the containing class plus any classes derived from the containing class or any other class in the current assembly
- WS-Addressing
- WS-MetadataExchange
- WS-Security
- WS-Atomic Transaction
- All of the above
- ServiceContract
- OperationContract
- DataContract
- MessageContract
- well-known singleton
- well-known single call
- client activated
- context-agile
- 1
- 25
- 250
- 100
- 500
- Restricted to a Specific Application
- Restricted to a Specific AppDomain
- Restricted to a Specific User
- Restricted to a specific Physical Media
- The compiler generates a backing field that is completely inaccessible from the application code.
- The compiler generates a backing field that is a private instance member with a leading underscore that can be programmatically referenced.
- The compiler generates a backing field that is accessible via reflection
- The compiler generates a code that will store the information separately from the instance to ensure its security.
- All elements in the initializer list must be of the same type.
- All elements in the initializer list must be implicitly convertible to a known type which is the actual type of at least one member in the initializer list
- All elements in the initializer list must be implicitly convertible to the common type which is the base type of the items actually in the list
- There are no restrictions on the items in the initializer list as the array is not declared to be a specific type.
- It always references the UTC (GMT) time
- It always references the Local time
- It contains a member indicating which time zone it refers to
- It contains a member indicating whether the time is UTC, Local, or Unspecified
- class Sample { public static Sample() { } }
- class Sample { static Sample() { } }
- class Sample { static Sample(int value) { } }
- class Sample { static void Sample() { } }
- System.Web.Mail is not supported under version 3.5 of the Framework
- System.Web.Mail is deprecated under version 3.5 of the Framework, and it is officially recommended that System.Net.Mail be used.
- System.Web.Mail is the preferred solution when using IIS hosted applications
- There are no functional differences; the items were moved to a new namespace to reflect their applicability in a better way
- Structs can not implement interfaces
- Structs cannot inherit from a base struct
- Structs cannot have events interfaces
- Structs cannot have virtual methods
- You declare (explicitly or implicitly) the accessibility of the property and get and set accessors but do not provide any implementation or backing field
- You attribute a member field so that the compiler will generate get and set accessors
- The compiler creates properties for your class based on class level attributes
- They are properties which are automatically invoked as part of the object construction process
- F1(j);
- F1(k);
- F1(1, 2, 3);
- F1(new [] {1,2,3})
- None of the above
- A Nullable type is a reference type.
- A Nullable type is a structure.
- An implicit conversion exists from any non-nullable value type to a nullable form of that type.
- An implicit conversion exists from any nullable value type to a non-nullable form of that type.
- A predefined conversion from the nullable type S? to the nullable type T? exists if there is a predefined conversion from the non-nullable type S to the non-nullable type T
- Defining methods dynamically.
- Defining types dynamically
- Defining assemblies dynamically
- Defining Instances dynamically
- Exporting an executable code to a disk based assembly
- None of the implementations are FIPS-certified
- Support is provided for the “Suite B” set of cryptographic algorithms as specified by the National Security Agency (NSA) .
- Cryptography Next Generation (CNG) classes are supported on XP and Vista systems
- The System.Security.Cryptography.AesManaged class allows custom block size, iteration counts and feedback modes to support any the Rijndael based encryption.
- ApplicationException
- DataMisalignedException
- ExecutionEngineException
- SystemException
- public Sample() : this(1) { }
- public Sample() : Sample(1) {}
- Both of the above
- One class constructor can not directly access another constructor
- The method provided by the TimerCallback delegate will always be invoked on the thread which created the timer.
- The thread which creates the timer must have a message processing loop (i.e. be considered a UI thread)
- The class contains protection to prevent reentrancy to the method provided by the TimerCallback delegate
- You can receive notification of an instance being Disposed by calling an overload of the Dispose method.
- void Sample1(object o) { int i = (int)o; }
- void Sample1(ValueType vt) { int i = (int)vt; }
- enum E { Hello, World} void Sample1(System.Enum et) { E e = (E) et; }
- interface I { int Value { get; set; } } void Sample1(I vt) { int i = vt.Value; }
- class C { public int Value { get; set; } } void Sample1(C vt) { int i = vt.Value; }
- It provides an exact point in time relative to the UTC time zone
- It combines a DateTime structure with a TimeZone structure
- It provides arithmetical operations using values with different offsets from the UTC
- It can be used to determine the specific TimeZone for a local time
- There is no supported application level means to determine if a specific amount of memory is available.
- using static methods of System.Runtime.MemoryFailPoint and checking the return value
- creating an instance of System.Runtime.MemoryFailPoint and monitoring for an InsufficientMemoryException
- creating an instance of System.Runtime.MemoryFailPoint and monitoring for an OutOfMemoryException
- A Partial trust code can not emit and execute a code
- The generated code has no more permissions than the assembly which emitted it.
- It can be executed by calling System.Reflection.Emit.DynamicMethod( string name, Type returnType, Type[] parameterTypes ) without any special permissions
- None of the above
- It must begin with a from clause
- It must begin with a select clause
- It can end with a group clause
- An orderby clause may optionally follow a select clause
- The permissions of the code which invoked the Demand method will be evaluated.
- For permissions which do a stack walk, an exception will occur only if NONE of the calling codes has the required permission
- For permissions which do a stack walk, an exception will occur if ANY of the calling codes does not have the required permission
- The permission levels of individual stack frames are always checked regardless of the permission type.
- They encapsulate native resource and must be properly Disposed to prevent potential exhausting of resources.
- They are all MarshalByRef derived classes, but functionality across AppDomains has specific limitations.
- You can inherit from these classes to provide enhanced or customized functionality
- They are Value Type objects.
- MyEventHandlerType must be derived from System.EventHandler or System.EventHandler<TEventArgs>
- MyEventHandlerType must take two parameters, the first of the type Object, and the second of a class derived from System.EventArgs
- MyEventHandlerType may have a non-void return type
- If MyEventHandlerType is a generic type, event declaration must use a specialization of that type.
- MyEventHandlerType cannot be declared static
- Developers can create assemblies directly from the MSIL Source Code.
- Developers can examine PE header information in an assembly.
- Developers can generate XML Schemas from class definitions contained within an assembly.
- Developers can strip all meta-data from managed assemblies.
- Developers can split an assembly into multiple assemblies.
- C# allows non-type template parameters
- C# supports explicit specialization
- C# allows the type parameter to be used as the base class for the generic type
- C# allows a generic type parameter itself to be a generic
- C# enforces that all codes are valid for all types of parameters
llowing code will be: string t = “This Is a Test”; t.Replace(“T”, “?”); Console.WriteLine(t); Answers:
- ?his Is a ?est
- ?his Is a ?es?
- This Is a Test
- ?his Is a Test
- They can be derived from any reference type.
- Two anonymous types with the same named parameters in the same order declared in different classes have the same type.
- Anonymous types can have methods
- All properties of an anonymous type are read/write
- When multiple versions of an assembly are available on the search path (AKA private assemblies), the runtime will use the first matching assembly with a version number equal to or higher than the assembly version that was originally linked against.
- When assemblies are resolving in the GAC (AKA shared assemblies), both the originator and the version are considered in determining the appropriate assembly.
- Configuration files can be used to override the version specified at build time.
- Strong Names are not required to utilize .NET’s versioning capabilities
- They must be inherited from the System.Attribute.
- Attributes are instantiated at the same time as instances of the class to which they are applied.
- Attribute classes may be restricted to be applied only to application element types.
- By default, a given attribute may be applied multiple times to the same application element.
- It is an O/RM (object relational mapping) implementation.
- It is a set of enhancements to the DataSet and DataTable classes.
- It requires the use of the SQLServer as the database
- Because LINQ is based on Queries, it can not be used to modify the data in the database.
- None of the above
- Enabling object pooling requires an attribute on the class and the enabling of pooling in the COM+ catalog.
- Methods can be configured to automatically mark a transaction as complete by the use of attributes.
- You can configure authentication using the AuthenticationOption when the ActivationMode is set to Library.
- You can control the lifecycle policy of an individual instance using the SetLifetimeService method.
No comments:
Post a Comment