-
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
-
Is there an equivalent to the instanceof operator in Visual J++?
C# has the is operator: expr is type
-
What is similar in concept to IL?
Skill/Topic: IntermediateA) Java Byte CodeB) C++ LibrariesC) Machine Language
-
Method Overloading and Overriding are the same
Skill/Topic: IntermediateA) TrueB) FalseExplanation: Overloading is changing the behavior of a method in a derived class, whereas overriding is having multiple methods with the same name
-
Garbage Collector:
Skill/Topic: AdvancedA) Copies the IL code to the heapB) Destroys the pointersC) is responsible for automatic memory management
-
Does Console.WriteLine() stop printing when it reaches a NULL character within a string?
Strings are not null terminated in the runtime, so embedded nulls are allowed. Console.WriteLine() and all similar methods continue until the end of the string.
-
Why do I get a syntax error when trying to declare a variable called checked?
The word checked is a keyword in C#.
-
How do destructors and garbage collection work in C#?
C# has finalizers (similar to destructors except that the runtime doesn't guarantee they'll be called), and they are specified as follows: class C{~C(){// your code}public static void Main() {}}Currently, they override object.Finalize(), which is called during the GC process.
-
How do I convert a string to an int in C#?
Here's an example: using System;class StringToInt{public static void Main(){String s = "105";int x = Convert.ToInt32(s);Console.WriteLine(x);}}
-
ByteArray Class
Write a class called ByteArray that implement allocating, reading and writing to an array of bytes. The runtime environment has a limitation. The maximum continuous memory size that it can allocated is 64k bytes. It can allocate many 64K ( or less) chunks. The ByteArray class should hide this limitation and support allocating arrays larger than 64K as in the following example :ByteArray ba = new ByteArray...
-
Whitespace in XML Parser
When whitespace is encountered by an XML parser within the element content, how is it handled by the XML parser?
-
-
-
Singleton Class
Give an example of inbuilt Singleton Class in .NET.
-
Value Types are stored on the heap ..? Is it true/False ?
Skill/Topic: AdvancedA) TrueB) False
-
-
-
C# Program to test efficient coding
You have several instances of the following class (User). Provide a class with three methods:"AddUser" accepts a User instance as a parameter and add it to a collection."GetUser" accepts a UserID as a parameter and returns the corresponding User instance. It is important that this executes quickly as it will be used often."GetOrderedUserArray" returns an array of User instances ordered by UserID....
-
What does the keyword virtual mean in the method definition?
The method can be over-ridden.
-
Variable Declaration and Assignment
What is difference between these two statement? if variable is declared and assign value in following two waysString sValue = (String)GridView1.DataKeys[GridView1.SelectedIndex].Value;String sValue = GridView1.DataKeys[GridView1.SelectedIndex].Value.ToString();
C# Interview Questions
Ans