-
The following is a correct call to the Main() function
Skill/Topic: BeginnerA) static void Main()B) static Main(void)C) Main()
-
What is the C# equivalent of System.Single
A) Float (16-bit)B) Float (32-bit)C) Float(64-bit)
-
What does the volatile modifier do
A) The value of the object is written immediately on assignmentB) The value is lost after the system reads it.C) The system stored the value until the end of all current threadsD) The system always reads the current value of a volatile object at the point it is requested
-
Which is not cls compliant built in value type?
Intushortdecimalenum
-
Can you allow class to be inherited, but prevent the method from being over-ridden?
Yes, just leave the class public and make the method sealed.
-
-
-
Which of the following is not a subclass of Value Type class
A) EnumerationsB) User defined value typesC) Boxed value typesExplanation: Boxed value types are of reference types
-
.NET run time relies on the object reference counts to manage memory
A) TrueB) FalseExplanation: .Net run time relies on Garbage Collection to manage memory
-
Class Design
. Below is a set of birds and movements they can perform. Birds:Penguin:• hopping: moves 2 ft• flying: can't flyHawk:• hopping: can't hop• flying: moves 100 ft; won't fly if World.windSpeed > 40Robin:• hopping: moves 1 ft; won't hop if World.temperature < 0• flying: moves 20 ft; won't fly if World.windSpeed > 20Crow:• hopping: moves 1 ft; won't hop if World.temperature < 0• flying: moves 30 ft; won't...
-
-
Is it possible to have different access modifiers on the get/set methods of a property?
No. The access modifier on a property applies to both its get and set accessors. What you need to do if you want them to be different is make the property read-only (by only providing a get accessor) and create a private/internal set method that is separate from the property.
-
-
What is the order of destructors called in a polymorphism hierarchy
A) Starts with derived class ends at base classB) Starts with base class ends at derived classC) The destructor of base can not becalledD) RandomlyExplanation: Uses Bottomup approach while calling Destructors from derived class
-
-
What is the difference between // comments, /* */ comments and /// comments?
Single-line, multi-line and XML documentation comments.
-
The base class Arrray belongs to the mamespace
Skill/Topic: IntermediateA) GlobalTypeB) ArraysC) System
-
Threading
Write a very simple multi threaded program in C#. 1. The program should create two threads that each add data to the same list at the same time. Then after they are both done, print out the entire list. 2. So each thread should loop through 100 times adding the name of the thread doing the work to the list. For example, the first thread should add the string "thread1" to the shared list and the second...
-
Classes Interface
Explain how many classes can an interface inherit?
-
Can you override private virtual methods?
No, moreover, you cannot access private methods in inherited classes, have to be protected in the base class to allow any sort of access.
C# Interview Questions
Ans