-
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 of the following is wrong with regards to Out keyword
A) For Out parameters a variable can be passed which has not initializedB) If Out parameters are not assigned a value with in the function body compiler throws errorC) The variable passed as a Out parameter must be static
-
Assembly version information is stored in the:
Skill/Topic: AdvancedA) ManifestB) Garbage CollectorC) Heap
-
C# Serializable Keyword
What is the use of serializable keyword in C#?
-
-
Can you prevent your class from being inherited and becoming a base class for some other classes?
Yes, that is what keyword sealed in the class definition is for. The developer trying to derive from your class will get a message: cannot inherit from Sealed class WhateverBaseClassName. It is the same concept as final class in Java.
-
Unsafe Keyword
Why we use pointer in C#.NET with Unsafe keyword?
-
C# Error - Overload for method
I took a button in form.I have two classes emp and bonus.bonus class is inherited from emp class.If bonus is giving ie in dialog box if we select ‘Yes’ b ie bonus is added to sal and we get ts ie total sal along with eno.If bonus is not given ie in dialog box if we select ‘No’ we need to get only sal along with eno.The following pgm is working fine.class emp { private int...
-
Where does the version dependencies recorded
A) Inside an assembly’s manifestB) Along with the project propertiesC) Both
-
Is there a way to force garbage collection?
Yes. Set all references to null and then call System.GC.Collect().If you need to have some objects destructed, and System.GC.Collect() doesn't seem to be doing it for you, you can force finalizers to be run by setting all the references to the object to null and then calling System.GC.RunFinalizers().
-
What is managed code?
Skill/Topic: IntermediateA) Code managed ouside the ILB) Code which can't be managed by the ILC) Code written in VB.NETD) Code to be compiled by IL
-
What is the difference between const and static read-only?
The difference is that static read-only can be modified by the containing class, but const can never be modified and must be initialized to a compile time constant. To expand on the static read-only case a bit, the containing class can only modify it:-- in the variable declaration (through a variable initializer).-- in the static constructor (instance constructors if it's not static).
-
YIELD Keyword
What is the purpose of YIELD Keyword in C#?
-
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();
-
What does the keyword virtual mean in the method definition?
The method can be over-ridden.
-
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....
-
-
-
Value Types are stored on the heap ..? Is it true/False ?
Skill/Topic: AdvancedA) TrueB) False
-
Singleton Class
Give an example of inbuilt Singleton Class in .NET.
C# Interview Questions
Ans