-
C# sealed variables
I have taken a windows application and a button control in it.I want to declare a variable as a sealed and use that variable with in same class as we cannot use in other class. class test { public sealed int x = 5; public void abc() { MessageBox.Show(x.ToString()); } } class best :test { ...
-
-
-
In C# events are actually a special form of delegates
A) TrueB) False
-
What happens if we refer a variable which in not initialized in C#
A) Compiler throws warning messageB) Compiler throws error messageC) Compiles the application with out any problemExplanation: Variable needs to be initialized before use
-
Following are the collections in C#:
Skill/Topic: AdvancedA) structsB) enumC) dictionariesExplanation: Ans. b & c. a isn’t a collection .
-
Any process can be divided into multiple
Skill/Topic: AdvancedA) ProgramsB) ThreadsC) Application domains
-
My switch statement works differently! Why?
C# does not support an explicit fall through for case blocks. The following code is not legal and will not compile in C#: switch(x){case 0:// do somethingcase 1:// do something in common with 0default:// do something in common with//0, 1 and everything elsebreak;}To achieve the same effect in C#, the code must be modified as shown below (notice how the control flows are explicit): class Test{public...