-
What does Main method returns in C#
A) StringB) IntegerC) FloatExplanation: Main returns either Nothing or int
-
If you need your own implementation of Equals method of object what needs to be done
A) Overload Equals methodB) Override Equals methodC) Implements Equals method
-
How to get the capacity of an array in C#
A) Count PropertyB) Length PropertyC) Ubound method
-
What happens when a C# project has more than 1 Main methods
A) Compiler throws warning messageB) Compiler throws Error messageC) Compiler successfully compiles
-
How are the attributes specified in C#
A) Enclosed with in [ ]B) Enclosed with in ( )C) Enclosed with in { }
-
What is the output of Vectors.RemoveAt(1)
A) Removes the object whose key is 1B) Removes the object whose value is 1C) Removes the object at position 1
-
What is the C# equivalent of System.Single
A) Float (16-bit)B) Float (32-bit)C) Float(64-bit)
-
-
-
-
-
-
-
-
-
MFC GUI without flickering
User is continuously entering some in GUI and it is doing some background processing and updating in GUI. How to do it without flickering the GUI using MFC?Thanks,Raja Gregory
-
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