1.Which of the following are true when comparing built in types for equality?
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
StringBuilder sb = new StringBuilder(10);
sb.AppendFormat(“1234567890123”);
Console.WriteLine(sb.Capacity);
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
{
public Sample(int x) { }
}
In the above code, which of the following other class constructors can directly access the provided constructor?
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
string t = “This Is a Test”;
t.Replace(“T”, “?”);
Console.WriteLine(t);
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
- Integral types are considered equal if they represent the same value.
- Object types are considered equal if they both refer to the same object or if both are null
- String types are considered equal if they have identical lengths and identical characters in each character position
- String types are considered equal if they have identical dimensions and identical content at each array index
Answers:
- int
- double
- string
- long
- float
Answers:
- System.Reflection.PropertyInfo
- System.Reflection.EventInfo
- System.Type
- System.Reflection.InstanceInfo
Answers:
- If a class implements an interface, the implementation can be provided by a public member of a base class.
- A class may partially implement an interface by only declaring some of the members
- Interface methods may be implemented so that they are NOT directly accessible using an instance reference to the class
- Since interface implementation methods can not be declared private,protected, or internal, they are always accessible from any point in an application
Answers:
- Assignment (=)
- Conditional (&&,||)
- Logical (&,|,^)
- Shift (<<, >>)
Answers:
- It provides communication across heterogeneous networks
- It provides communication when one of the endpoints may be off-line
- It may behave differently depending on the current operating system
- A new system level queue may be created simply by creating an instance of MessageQueue.
Answers:
- It is a statement block which may contain a yield return statement to provide the next value of the iteration
- It is a statement block which may contain a yield break statement to provide the next value of the iteration
- It is a statement block which may contain a yield return statement to indicate that the iteration is complete
- It is a statement block which may contain a yield break statement to indicate that the iteration is complete
- It is a class which implements Ienumerable
Answers:
- Changes to value parameters always involve making a copy of the original argument
- Items passed as Reference Parameters must be initialized prior to the call.
- Output Parameters do not need to be assigned inside the method
- Variable Length argument lists are not supported
Answers:
- 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 extracted 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.
Answers:
- 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 it
- Objects which implement finalizers will always have the finalizer called at some point
Answers:
- 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.
Answers:
- 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 only to be applied to application element types.
- By default, a given attribute may be applied multiple times to the same application element.
StringBuilder sb = new StringBuilder(10);
sb.AppendFormat(“1234567890123”);
Console.WriteLine(sb.Capacity);
Answers:
- 10
- 20
- Some value equal to or larger than 13
- Int32.MaxValue
Answers:
- separating an item’s public interface from the actual implementation
- embedding content as a resource into an executable program
- providing a short summary description of complex operations
- a technique using base and derived classes
Answers:
- A single assembly may contain multiple namespaces
- The same namespace may be used in multiple assemblies
- Namespaces may be aliased to provide a shorthand notation for a fully qualified identifier
- All of the above
Answers:
- C# does not support the use of “*” to indicate a pointer.
- Pointers are a type derived from System.Object
- Pointers can be used as out and ref type parameters
- Pointer references are tracked by the garbage collector.
Answers:
- System.Threading.Timer A 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 the System.Windows.Forms.Timer instances.
- System.Windows.Forms.Timer A lower resolution timer which requires a UI message pump on the creating thread.
- All of the above
Answers:
- SQL Server
- ADO.NET
- MSMQ
- Microsoft Distributed Transaction Coordinator (MSDTC).
- All of the above
Answers:
- Added
- Modified
- Dirty
- Detached
- Deleted
Answers:
- System.DateTime
- System.TimeSpan
- System.Globalization.Calendar
- System.Globalization.CultureInfo
Answers:
- 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.
- All of the above
Answers:
- #define
- #line
- #include
- #error
- #pragma
Answers:
- int
- sbyte
- long
- All of the above
Answers:
- Methods
- Events
- Fields
- Indexers
Answers:
- Exceptions should be derived from the System.Exception, but are not required to do so.
- If no catch block is found for an exception, and the source is not a static constructor, a System.ThreadException will be thrown
- Mathematical errors such as divide by zero, or numeric overflow will generate an exception that is derived from System.Exception
- Every throw statement must have at least one catch block
Answers:
- For reference types A and B; if a conversion from A to B exists, a conversion from A[] to B[] also exists
- For value types A and B; if a conversion from A to B exists, a conversion from A[] to B[] also exists
- Assignments to arrays elements may require a runtime check to validate the type safety of the assignment
Answers:
- It renders the resources unavailable.
- It ensures that resources are used only with the appropriate culture
- It prevents identifier collisions between multiple satellite assemblies
- It has no impact since access specifiers for resources are not applied.
Answers:
- you should modify the COM component to enable CLR functionallity.
- you should use TlbImp.exe to create a managed wrapper
- you should use TlbExp.exe to create a managed wrapper
- you should enable an unsafe code
Answers:
- 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
Answers:
- ObjRef
- MarshalByRefObject
- ObjectHandle
- RemotingServices
Answers:
- 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 it is UTC, Local, or Unspecified
Answers:
- Anonymous methods have access to the local state of the containing function member.
- An anonymous method requires an explicit method signature
- An anonymous method can impact the lifetime of local variables and parameters of the containing function
- A struct may not declare an anonymous method which directly references member fields
Answers:
- sorted by Key
- sorted by Element
- not sorted
Answers:
- Manifest
- MetaData
- Intermediate Language Code
- Resources
- Native Executable Code
Answers:
- They encapsulate native resources and must be properly Disposed to prevent potential exhausting of resources.
- They are Value Type objects.
- You can inherit from these classes to provide enhanced or customized functionality
- None of the Above
Answers:
- DataContractAttribute
- DataMemberAttribute
- EnumMemberAttribute
- CollectionDataContractAttribute
- DataObjectAttribute
{
public Sample(int x) { }
}
In the above code, which of the following other class constructors can directly access the provided constructor?
Answers:
- public Sample() : this(1) { }
- public Sample() : Sample(1) {}
- Both the above.
- One class constructor can not directly access another constructor
Answers:
- class SampleClass {} class SampleClass<T> {}
- class SampleClass<T> {} class SampleClass<T,U> {}
- class SampleClass<T> where T : class { } class SampleClass<T> where T : struct { }
- class SampleClass {} class SampleClass<T> where T : class { }
Answers:
- A while statement will always execute its body at least once.
- A for loop will always execute its body at least once.
- A try statement must always include at least one catch block
- A case clause within a switch statement may not fall through to the next case clause
Answers:
- It is impossible to add a reference to both assemblies to any given assembly
- A new root can be added to the assemblies namespace hierarchy by the use of an extern alias
- The specific colliding name may be altered by using an extern alias
- The collision may be avoided by using a statement to provide an alias
Answers:
- A delegate requires an instance method be supplied.
- A delegate instance may encapsulate only one method
- Delegates are not typesafe
- A delegate instance does not know or care about the class type of the encapsulated method
Answers:
- 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.
Answers:
- Usage of system settings for size, color, and font
- Support for Windows “High Contrast” option
- Usage of sound to notify of critical information
- Keyboard only access to all features including menus, and controls
Answers:
- 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
Answers:
- Prevention of the caught exception from leaving the catch block
- Allowing the original exception to propagate after it has been caught, with all of the information (including context) intact
- Wrapping the caught exception inside a newly created exception of a different type
- Generating a new exception with no information about the original exception
- Altering the Message , TargetSite and/or StackTrace, of the existing exception before re-throwing
Answers:
- Start
- Continue
- Pause
- Restart
Answers:
- Structs can not implement interfaces
- Structs cannot inherit from a base struct
- Structs cannot have events interfaces
- Structs cannot have virtual methods
Answers:
- Enums are always equated to an integral constant value
- A variable of the enum type will always contain one of the declared symbolic constants
- The declared values of an enum are always assigned sequential starting with 0
- The declared values of an enum must be mapped (explicitly or implicitly) to unique integral values
Answers:
- 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.
Answers:
- ApplicationException
- DataMisalignedException
- ExecutionEngineException
- SystemException
Answers:
- Identifier
- Whitespace
- Punctuator
- Operator
- All of the above
Answers:
- Classes
- Structs
- Methods
- Fields
Answers:
- Restricted to a Specific Application
- Restricted to a Specific AppDomain
- Restricted to a Specific User
- Restricted to a specific Physical Media
Answers:
- 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.
Answers:
- One method may handle events from different sources
- A single event can be handled by multiple methods
- Event handlers can be dynamically added and removed at runtime
- All of the above
Answers:
- Trace is enabled for both Release and Debug initial configurations
- Trace can be controlled both by preprocessor directives, and compiler directives
- To change the severity levels which generate output, you must recompile your program
- All of the Above
Answers:
- not supported except for implementing an indexer.
- properties which take one or more parameters (e.g. to retrieve one element from a member collection)
- properies which use one or more attributes to control their behavior
- properties which can be passed as Method Parameters so they can be invoked by the called method.
Answers:
- ObjRef
- MarshalByRefObject
- ObjectHandle
- RemotingServices
Answers:
- 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
Answers:
- public static void Main() {}
- public static int Main() {}
- public static int Main(string[] args) {}
- public static int Main(string cmdline) {}
- private static int Main(string[] args) {}
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
Answers:
- The appropriate version of the .NET framework must be installed.
- All application components must be in the application directory, or a subdirectory.
- Shared components can be installed as part of the XCOPY.
- XCOPY deployment to a non-empty target directory may have unintended side-effects
Answers:
- The Conditional Operator (?:) has the lowest precedence.
- All binary operators are left-associative, and evaluate from left to right.
- The Assignment and Conditional Operators are right-associative.
- The Conditional And (&&) and Or (||) operators have higher precedence than the Logical And (&) and Or (|) operators.
Answers:
- ASCII
- Unicode
- UTF-7
- UTF-8
- EBCDIC
Answers:
- Methods
- Properties
- Fields
- Conversion operators
- Events
Answers:
- It provides synchronized operations viewing the content either as an XmlDocument or as a DataSet
- It provides the basic abilities for XMLDocument instances to be created from or exported to DataSets
- It provides a limited set of capabilities compared to the System.Xml.XmlDocument class
- It provides the basic abilities to allow DataSets to be loaded from or exported to XML files.
No comments:
Post a Comment