-
Which language is more suitable for writing extermely high performance mission critical applications?
Skill/Topic: AdvancedA) C#B) C++C) Visual Basic .NETExplanation: This is an area where C# lags.
-
What is automatic memory management in .NET known as:
Skill/Topic: AdvancedA) Managed CodeB) Smart CachingC) Garbage Collection
-
NET offers the follwing security features:
Skill/Topic: AdvancedA) Transaction based securityB) Code-based securityC) Both the aboveD) None of the above
-
Each process in a 32 bit Windows environment has the following amount of virtual memory available:
Skill/Topic: AdvancedA) 4 MBB) 400MBC) 4 GB
-
What are Namespaces
A) Naming convention used in .NetB) Group of classes categorized to avoid name clashC) None of the above
-
If we need to compare X to a value 3 how do we do it in C#
A) If (X==3)B) If (X=3)C) If (X.equals(3) )
-
-
Which method is implicitly called when an object is created
A) Main MethodB) Constructor MethodC) Destructor MethodExplanation: Constructor is the method which is implicitly created when ever a class is instantiated
-
In order to use stringbuilder in our class we need to refer
A) System.TextB) System.IOC) System.StringBuilder
-
How do you load assembly to running process
A) Assembly.Load( )B) Assembly.LoadFrom( )C) Both
-
Assemblies cannot be loaded side by side
A) TrueB) FalseExplanation: Assemblies can be loaded side by side
-
In the following cases which is not function overloading
A) Same parameter types but different return valuesB) Varying number of parametersC) Different parameters types but different return valuesD) Different parameters type but same return values
-
-
-
-
-
How do I do implement a trace and assert?
Use a conditional attribute on the method, as shown below: class Debug{[conditional("TRACE")]public void Trace(string s){Console.WriteLine(s);}}class MyClass{public static void Main(){Debug.Trace("hello");}}In this example, the call to Debug.Trace() is made only if the preprocessor symbol TRACE is defined at the call site. You can define preprocessor symbols on the command line by using the /D switch....
-
What is the syntax for calling an overloaded constructor within a constructor (this() and constructorname() does not compile)?
The syntax for calling another constructor is as follows: class B{B(int i){ }}class C : B{C() : base(5) // call base constructor B(5){ }C(int i) : this() // call C(){ }public static void Main() {}}
-
Is there an equivalent to the instanceof operator in Visual J++?
C# has the is operator: expr is type
-
Is there a way of specifying which block or loop to break out of when working with nested loops?
The easiest way is to use goto: using System;class BreakExample {public static void Main(String[] args) {for(int i=0; i<3; i++) {Console.WriteLine("Pass {0}: ", i);for( int j=0 ; j<100 ; j++ ) {if ( j == 10) goto done;Console.WriteLine("{0} ", j);}Console.WriteLine("This will not print");}done:Console.WriteLine("Loops complete.");}}
C# Interview Questions
Ans